Red Hat Bugzilla – Bug 113628
getaddrinfo no longer resolves 0 as 0.0.0.0 aka localhost
Last modified: 2016-11-24 10:22:25 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5)
Description of problem:
With glic2.3.2 getaddrinfo() no longer resolves 0 as 0.0.0.0 aka
localhost. In my experience, previous versions did. The
gethostbyname*() functions still do resolve 0 as 0.0.0.0.
I used a little testprog I will attach.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. compile my testprog
2. run it with argument '0': ./a.out '0'
Actual Results: Output of my testporg:
getaddrinfo: 0 unresolvable: Name or service not known
Expected Results: gethostbyname: 0.0.0.0
If this resolving issue is changed intentionally, I would have
appreciated it, if there had been some kind of documentation about the
change in this minor version upgrade. glibc2.3.1 still acts the way I
am used to.
Created attachment 97044 [details]
Little testprog using gethostbyname and getaddrinfo to resolve argv
Your testcase is buggy, a->ai_addr points to struct sockaddr_in in
your case, not IP itself.
Works for me just fine (after fixing that bug) with glibc-2.3.2-101.4 and glibc-2.3.2-95.6.
Please accept my excuses for sending in faulty code,
I never got to that part of the code, because in my case the
getaddrinfo() functions just failed (and still does).