RFC: getaddrinfo: skip DNS resolution for numeric addresses?

Denys Vlasenko vda.linux at googlemail.com
Tue May 3 15:43:04 UTC 2011


On Mon, Apr 4, 2011 at 3:16 AM, Denys Vlasenko <vda.linux at googlemail.com> wrote:
> Hi,
>
> I noticed that getaddrinfo will faithfully perform
> DNS resolution on hostnames such as "1.2.3.4"
>
> This is problematic in the case when user uses numeric IPs
> _exactly_ because he knows that his DNS resolution
> does not work. He'll have nasty surprise: numeric
> addresses won't work either!
>
> I added a workaround to busybox which detects this case.
>
> However, I think this should be done on libc level
> for all users of getaddrinfo.
>
> I can code it up.
>
> Does anyone object to this?

Looked at the code today and it apparently already skips DNS resolution
in this case.
Tried to reproduce it and experimentally it also skips DNS resolution.

Consider this closed for now, but I will keep an eye on it.
I remember there were cases when it did superfluous resolutions,
and git log doesn't show any fixes to that effect...

-- 
vda


More information about the uClibc mailing list