Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 105374 - getaddrinfo returns non-canonical node name
getaddrinfo returns non-canonical node name
Product: Red Hat Linux Beta
Classification: Retired
Component: glibc (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2003-09-25 11:02 EDT by David Woodhouse
Modified: 2016-11-24 09:54 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-09-28 03:09:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
test program (648 bytes, text/plain)
2003-09-25 11:04 EDT, David Woodhouse
no flags Details

  None (edit)
Description David Woodhouse 2003-09-25 11:02:49 EDT
See attached test program.

When invoked with IP addresses for which there is no reverse DNS, it should
surely fail? When invoked with a non-canonical IPv6 address, it should certainly
not just return the same text?

./asd 2002:c1ed:8229::1
getaddrinfo() succeeded, result 2002:c1ed:8229::1
./asd 2002:c1ed:8229:0::1
getaddrinfo() succeeded, result 2002:c1ed:8229:0::1

Either both the above should fail, or at least they should both return the
former result.
Comment 1 David Woodhouse 2003-09-25 11:04:22 EDT
Created attachment 94718 [details]
test program
Comment 2 Jakub Jelinek 2003-09-26 09:56:07 EDT
IMHO glibc is right:
- A numeric host address string is not a ``name'', and thus does not have a ``canonical name'' form
- if the canonical name is not available, then ai_canonname shall refer to the nodename argument or a string with the same contents.
Comment 3 David Woodhouse 2003-09-26 10:01:41 EDT
So it would be wrong to do a reverse-dns lookup for _any_ numerical input string?
And hence _this_ would be a bug....

$ ./asd
getaddrinfo() succeeded, result dwmw2.baythorne.internal

Comment 4 Ulrich Drepper 2004-09-28 03:09:12 EDT
You are right, for numeric addresses as name parameter ai_canonname
must always be a copy of the input string.  I've changed that in the
current CVS code.  Will be in 2.3.3-59 or so.

Note You need to log in before you can comment on or make changes to this bug.