[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug in getaddrinfo.c
From: |
Simon Josefsson |
Subject: |
Re: bug in getaddrinfo.c |
Date: |
Tue, 28 Nov 2006 21:14:35 +0100 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.91 (gnu/linux) |
eponymous alias <address@hidden> writes:
> The getaddrinfo.c file contains these lines within getaddrinfo():
>
> 151 if (hints && (hints->ai_flags & ~(AI_CANONNAME|AI_PASSIVE)))
> 152 /* FIXME: Support more flags. */
> 153 return EAI_BADFLAGS;
>
> followed later by:
>
> 181 if (!(hints->ai_flags & AI_NUMERICSERV))
> 182 /* FIXME: Use getservbyname_r if available. */
> 183 se = getservbyname (servname, proto);
>
> But to properly support this latter code, the earlier test must include
> the AI_NUMERICSERV flag.
Thanks, could you test the patch below? Please also test if
AI_NUMERICSERV really works. If it doesn't work, the flag probably
should be rejected. The code seems untested.
/Simon
2006-11-28 Simon Josefsson <address@hidden>
* lib/getaddrinfo.c (getaddrinfo): Don't reject AI_NUMERICSERV
flags. Reported by eponymous alias <address@hidden>.
--- getaddrinfo.c 17 Nov 2006 14:45:55 +0100 1.20
+++ getaddrinfo.c 28 Nov 2006 21:12:05 +0100
@@ -148,7 +148,7 @@
return getaddrinfo_ptr (nodename, servname, hints, res);
#endif
- if (hints && (hints->ai_flags & ~(AI_CANONNAME|AI_PASSIVE)))
+ if (hints && (hints->ai_flags & ~(AI_CANONNAME|AI_PASSIVE|AI_NUMERICSERV)))
/* FIXME: Support more flags. */
return EAI_BADFLAGS;