00:29:51 -!- Phantom_Hoover has quit (Read error: Connection reset by peer). 00:36:15 -!- imode has joined. 01:12:30 -!- Sgeo has joined. 01:15:46 -!- Sgeo_ has quit (Ping timeout: 268 seconds). 01:18:56 -!- imode has quit (Quit: WeeChat 2.3). 01:23:31 How in C do I make a DNS lookup in order to compare the result with the result if a inet_aton() call? 01:23:41 s/result if a/result of a/ 02:09:40 -!- Essadon has quit (Quit: Qutting). 02:09:57 -!- arseniiv has quit (Ping timeout: 252 seconds). 02:33:28 -!- b_jonas has quit (Quit: Lost terminal). 03:32:17 zzo38: Wouldn't you use gethostbyaddr? 03:32:49 Or, really, to be reasonably modern and not-obsolescent, getaddrinfo 03:33:54 I am not trying to perform a reverse DNS lookup (since the reverse DNS might not match the name that the server wants to use anyways) 03:35:23 Yeah, sorry, gethostbyname, but getaddrinfo 03:35:39 Also the type does not seem to match? 03:37:23 The struct sockaddr type is a generic type -- you're intended to look at ai_family to know which type to cast the pointer to. 03:38:46 If it is compared the length sizeof(struct in_addr) will that work then? 03:38:51 No. 03:39:38 struct sockaddr_in, the type for an IPv4 address-and-port, contains a struct in_addr. 03:39:50 https://beej.us/guide/bgnet/html/multi/sockaddr_inman.html is a halfway decent explanation 03:40:10 O, OK. 03:41:24 Currently this program is only IPv4, although later I can fix it so that if the REMOTE_HOST environment variable specifies a IPv6 address then the DNS lookup will use IPv6 instead. 03:41:38 -!- lifthrasiir has quit (Remote host closed the connection). 03:42:47 You'd probably have an easier time just trying to rewrite it to work entirely with getaddrinfo, since getaddrinfo handles it a bit more comprehensively and correctly than you're likely to yourself. 03:42:55 -!- lifthrasiir has joined. 03:44:37 OK, but can the address be compared properly by use of getaddrinfo? The address to compare it to is the contents of the REMOTE_HOST environment variable (set by xinetd, and contains a numeric dotted quad address) 03:46:12 Well, you can get the struct in_addr or struct in6_addr out of the getaddrinfo results just fine. 03:47:39 Yes, and then can do the comparison with that, will work I suppose, since it is only the IP address which needs to be compared. 03:50:07 Also getaddrinfo can return multiple addresses, and won't that waste memory? 03:50:28 It does briefly -- this is why freeaddrinfo exists. 03:50:48 freeaddrinfo will free *all* of the allocated memory. 03:51:50 What is the limit to how much memory it can use? 03:58:02 The API as stated does not impose any real limits. However, because it makes a DNS query over UDP in practice, that imposes a limit of at most 48 struct addrinfos being allocated. 03:58:34 (and the actual memory usage is a function of the number of A and AAAA records for the queried host) 04:05:27 -!- Sgeo has quit (Read error: Connection reset by peer). 04:09:25 -!- Sgeo has joined. 04:15:37 It seem it can be a problem if it can be caused to waste too much memory 04:21:33 I found a report of a security problem with these DNS resolving functions, although it seems to be applicable only to AAAA records. I do not have IPv6, so presumably it is OK 05:03:46 -!- imode has joined. 05:46:43 -!- Lord_of_Life has quit (Ping timeout: 245 seconds). 05:49:21 -!- Lord_of_Life has joined. 05:49:21 -!- Lord_of_Life has quit (Changing host). 05:49:21 -!- Lord_of_Life has joined. 06:29:39 -!- xkapastel has quit (Quit: Connection closed for inactivity). 06:37:29 OK I think I implemented it now (with getaddrinfo), now I can try to test 06:41:58 Yes, it look like it is work 07:21:18 -!- atslash has joined. 07:45:03 -!- imode has quit (Ping timeout: 245 seconds). 08:18:42 -!- oerjan has joined. 09:22:42 -!- hexfive has joined. 10:57:55 -!- oerjan has quit (Quit: Later). 11:11:53 -!- AnotherTest has joined. 12:02:27 -!- Melvar has quit (Ping timeout: 240 seconds). 12:15:10 -!- Melvar has joined. 12:27:55 [[Alchemist]] N https://esolangs.org/w/index.php?oldid=58500 * BMO * (+3626) Created page with "{{infobox proglang |name=6 |paradigms=[[:Category:Nondeterministic|non-deterministic]] |author=[https://esolangs.org/wiki/User:BMO BMO] |year=[[:Category:2018|2018]] |typesy..." 12:32:38 [[User:BMO]] https://esolangs.org/w/index.php?diff=58501&oldid=57097 * BMO * (+141) 13:04:18 [[Alchemist]] https://esolangs.org/w/index.php?diff=58502&oldid=58500 * BMO * (+298) 13:08:14 -!- Phantom_Hoover has joined. 13:09:16 -!- paul2520 has quit (Ping timeout: 246 seconds). 13:10:18 -!- paul2520 has joined. 13:24:30 -!- paul2520 has quit (Ping timeout: 250 seconds). 13:46:37 -!- xkapastel has joined. 13:51:22 -!- paul2520 has joined. 13:51:22 -!- paul2520 has quit (Changing host). 13:51:22 -!- paul2520 has joined. 13:53:43 -!- Essadon has joined. 14:13:45 -!- Phantom_Hoover has quit (Ping timeout: 252 seconds). 14:16:25 -!- hexfive has quit (Quit: WeeChat 2.2). 14:16:53 -!- Phantom_Hoover has joined. 15:14:01 -!- arseniiv has joined. 15:20:51 -!- Phantom_Hoover has quit (Ping timeout: 252 seconds). 15:40:45 [[Alchemist]] https://esolangs.org/w/index.php?diff=58503&oldid=58502 * BMO * (+6) 15:55:12 -!- Phantom_Hoover has joined. 16:58:47 -!- Sgeo has quit (Ping timeout: 240 seconds). 17:00:35 -!- Sgeo has joined. 17:39:39 -!- b_jonas has joined. 17:40:04 zzo38: I may be misunderstanding this, but I think getaddrinfo allocates a linked list, and you can use freeaddrinfo to free any tail of that list 17:40:55 -!- imode has joined. 17:43:54 zzo38: but sure, there are other DNS query libraries out there if that's what you want 17:44:00 ones that behave very different from libc 17:46:02 -!- Lord_of_Life_ has joined. 17:49:46 -!- Lord_of_Life has quit (Ping timeout: 272 seconds). 17:49:47 -!- Lord_of_Life_ has changed nick to Lord_of_Life. 17:49:47 -!- Lord_of_Life has quit (Changing host). 17:49:47 -!- Lord_of_Life has joined. 18:05:24 -!- AnotherTest has quit (Ping timeout: 252 seconds). 19:03:57 -!- imode has quit (Quit: WeeChat 2.3). 19:08:51 @search jokes 19:08:51 Unknown command, try @list 19:09:03 oops, wrong channel! 19:27:56 -!- imode has joined. 19:45:58 b_jonas: I am implementing the Netsubscribe program, and I have implemented the DNS verification that works (it frees the entire list after checking though, since only the first entry is used; the address from it is copied out anyways) 20:03:53 -!- imode has quit (Quit: WeeChat 2.3). 20:26:15 -!- imode has joined. 21:16:59 -!- AnotherTest has joined. 21:26:49 -!- imode has quit (Quit: WeeChat 2.3). 22:05:48 -!- moei has quit (Quit: Leaving...). 22:14:21 -!- Sgeo_ has joined. 22:16:27 -!- Sgeo has quit (Ping timeout: 240 seconds). 22:31:06 -!- AnotherTest has quit (Ping timeout: 260 seconds). 22:50:54 `" 22:50:55 872) GreyKnight: And Gregor itself is kind of a probability distribution spread all over the globe. \ 1248) I've heard that scow is oerjanspeak for something 22:51:00 `wisdom 22:51:01 ​norway//Norway is the suburb capital of Sweden. It's where the Nobel Peace Prize is announced. It's a warm, dry place, at least compared to Québec. 22:51:11 `wisdom 22:51:12 ​ronald reagan//Ronald Reagan was an actor so great that he managed to convince the US that he was the President. Then he created the Star Wars project to destroy the Soviet Union. 22:55:46 `? star wars 22:55:47 Star Wars was a missile defence system invented by Ronald Reagan. With it, he managed to destroy the Soviet Union, then rode into the sunset. 23:26:24 -!- Essadon has quit (Quit: Qutting).