This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: reverse look up of INADDR_ANY, etc.


> On 11/23/2009 08:33 PM, danielcavanagh@aanet.com.au wrote:
>> is this consider a bug? if so, do you need me to file a report?
>
> Not a bug.  It's "garbage in, garbage out".  Just like any other invalid
> address you will get the correct result but it'll take it's time for the
> timeout to kick in.
>
> You'll have to show me a valid program which can regularly create such
> calls t convince me otherwise.

this was found in the ruby language. there is a TCPServer class whose
purpose should be clear. when you access the addr variable of this class,
it returns an array with the address family, the port, the ip address and
domain name bound to. the most common address to bind to is obviously
INADDR_ANY, which then gets automatically looked up, leading to a huge
pause  on startup for most things using TCPServer on a glibc system

really, the check should be pushed as far down the code path as possible
and the very bottom is glibc. it's more efficient that way and avoids
duplication. and as i said, every other system i've seen works properly
(all the bsds, haiku, windows, non-glibc-based linuxes) so glibc should
too

i should add that haiku did previously have this same bug but someone
discovered and reported it and it got fixed. i'm not sure how it was
discovered though

i personally don't really care about the checks for anything but
INADDR_ANY, since i also can't foresee a situation where the others are a
problem, but INADDR_ANY is a problem, so can't a simple "if (addr ==
INADDR_ANY) return NULL;" or whatever be added?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]