Bug 113628

Summary: getaddrinfo no longer resolves 0 as 0.0.0.0 aka localhost
Product: [Retired] Red Hat Linux Reporter: Rob de Wit <rdewit>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact: Brian Brock <bbrock>
Severity: low Docs Contact:
Priority: medium    
Version: 9CC: fweimer
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-01-15 22:57:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Little testprog using gethostbyname and getaddrinfo to resolve argv[1] none

Description Rob de Wit 2004-01-15 22:35:02 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5)
Gecko/20031007 Firebird/0.7

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):
glibc-2.3.2

How reproducible:
Always

Steps to Reproduce:
1. compile my testprog 
2. run it with argument '0': ./a.out '0'

    

Actual Results:  Output of my testporg:
gethostbyname: 0.0.0.0
getaddrinfo: 0 unresolvable: Name or service not known
    

Expected Results:  gethostbyname: 0.0.0.0
getaddrinfo: 0.0.0.0

Additional info:

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.

Comment 1 Rob de Wit 2004-01-15 22:37:30 UTC
Created attachment 97044 [details]
Little testprog using gethostbyname and getaddrinfo to resolve argv[1]

Comment 2 Jakub Jelinek 2004-01-15 22:57:10 UTC
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.

Comment 3 Rob de Wit 2004-01-16 11:54:15 UTC
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).