Bug in STABLE innfeed
Julien ÉLIE
julien at trigofacile.com
Wed May 14 19:03:21 UTC 2008
Hi Miquel,
> It's standard getaddrinfo() behaviour. It returns the same address
> three times .. a small test program that prints the return
> values of getaddrinfo shows:
>
> $ ./getaddrinfo feeder.erje.net
> family: 2, socktype: 1, protocol: 6
> family: 2, socktype: 2, protocol: 17
> family: 2, socktype: 3, protocol: 0
>
> (that's protocol TCP, UDP, and IP)
All right. Thanks!
> That bug must always have been there (when compiling for IPv6).
Hmm... Unfortunately, the line you mention for hints.ai_socktype was
inadvertently removed by that patch:
@@ -1127,10 +1157,12 @@
struct addrinfo hints;
memset(&hints, 0, sizeof(hints));
- hints.ai_family = host->params->forceIPv4 ? PF_INET : PF_UNSPEC;
- hints.ai_socktype = SOCK_STREAM;
- gai_ret = getaddrinfo(host->params->ipName, NULL, &hints, &res);
- if (gai_ret != 0 || res == NULL)
+ hints.ai_family = family ? family : AF_UNSPEC;
+#ifdef AI_ADDRCONFIG
+ hints.ai_flags = AI_ADDRCONFIG;
+#endif
+ if((gai_ret = getaddrinfo(host->params->ipName, NULL, &hints, &res)) != 0
+ || res == NULL)
{
warn ("%s can't resolve hostname %s: %s", host->params->peerName,
host->params->ipName, gai_ret == 0 ? "no addresses returned"
> This isn't really a big problem, things won't break. It just means
> that rotating the peer IP addressses is a bit slower than it could be.
Sure. No problem.
Thanks for having seen what the issue was.
--
Julien ÉLIE
« Attention aux bugs dans le code ci-dessus. Je ne l'ai pas testé,
j'ai seulement prouvé qu'il était correct. » (Donald Knuth)
More information about the inn-workers
mailing list