Skip Menu |
 

Subject: getaddrinfo wrapper not good enough on AIX
Donn Cave points out that AIX getaddrinfo returns a canonical-name field
that is allocated but not filled in. Meanwhile, some of our code is
relying on that field being filled in. The support for this case exists
in the wrapper code already, but is not turned on for AIX. Simply
turning it on for AIX results in some problems because apparently it's
using yet a third interface for gethostbyname_r that we don't support,
so that will need to be worked around too.

Broken in 1.3a1, probably should be fixed for 1.3 beta at latest.
Oh yes... my initial investigation also showed that AIX 4.3.3
getaddrinfo may not return all the IPv6 addresses available for the
supplied hostname. At least in the case of raeburn.org, which has two
IPv6 addresses, it returned only one, while nslookup on the same machine
showed both.

As with the similar problem on Linux, don't bother trying to fix it,
just make a prominent note of it in the code, and move on.... (Maybe
ask someone with a newer release to see if the problem still exists?)
To: donn@u.washington.edu
Cc: krb5-bugs@MIT.EDU
Subject: [krbdev.mit.edu #1392] getaddrinfo wrapper not good enough on AIX
From: Ken Raeburn <raeburn@MIT.EDU>
Date: Tue, 01 Apr 2003 19:25:27 -0500
RT-Send-Cc:
Hi, Don. Could you try out the attached patch and let me know if it
fixes the ai_canonname problems we were discussing for you?

Ken
Download f13
application/octet-stream 3.6KiB

Message body not shown because it is not plain text.

From: raeburn@mit.edu
Subject: CVS Commit
* fake-addrinfo.h (COPY_FIRST_CANONNAME) [_AIX]: Define.
(GET_HOST_BY_NAME) [_AIX]: New version for AIX version of gethostbyname_r.
(getaddrinfo) [NUMERIC_SERVICE_BROKEN]: Use "discard" as a dummy service name
instead of none at all. Don't check for unsigned value less than zero.
(getaddrinfo) [COPY_FIRST_CANONNAME]: Set any ai_canonname fields other than
the first one to null.


To generate a diff of this commit:



cvs diff -r1.349 -r1.350 krb5/src/include/ChangeLog
cvs diff -r1.34 -r1.35 krb5/src/include/fake-addrinfo.h
Date: Wed, 2 Apr 2003 12:03:44 -0800
To: Ken Raeburn <raeburn@MIT.EDU>
From: "Donn Cave" <donn@u.washington.edu>
Cc: <krb5-bugs@MIT.EDU>
Subject: Re: [krbdev.mit.edu #1392] getaddrinfo wrapper not good enough on AIX
RT-Send-Cc:
Download (untitled) / with headers
text/plain 1.9KiB
Quoth Ken Raeburn <raeburn@MIT.EDU>:
| Hi, Don. Could you try out the attached patch and let me know if it
| fixes the ai_canonname problems we were discussing for you?

It does, sort of. I hadn't actually even built 1.3 on AIX,
only tried fake-addrinfo.h on its own, but before trying your
patch I built it straight and verified that there actually is
a problem. And there is:
$ ./telnet -a homer.u
telnet: system library bug? getaddrinfo returns numeric address
as canonical name of homer.u
Trying 140.142.15.37...
telnet: connect to address 140.142.15.37: Can't assign requested address
telnet: Unable to connect to remote host: Can't assign requested address

After applying your patch, the "system library bug?" line went away.

The last two stayed, though, because of another problem in fake-addrinfo.h,
it applies the service host value that would have been computed if the
service were numeric, even when the service was not numeric and that value
was never computed. I hacked in a solution, context diff appended.

Finally, of course it still didn't work because the returned host name
is not canonical in the sense of reverse-lookup stable, but I gather
this is not the problem you're trying to solve here.

Donn Cave, University Computing Services, University of Washington
donn@u.washington.edu
-----------------------------
*** fake-addrinfo.h.p1 Wed Apr 2 09:46:08 2003
--- fake-addrinfo.h Wed Apr 2 11:51:06 2003
***************
*** 1054,1060 ****
#endif

#ifdef NUMERIC_SERVICE_BROKEN
! for (ai = *result; ai; ai = ai->ai_next) {
if (socket_type != 0 && ai->ai_socktype == 0)
/* Is this check actually needed? */
ai->ai_socktype = socket_type;
--- 1054,1060 ----
#endif

#ifdef NUMERIC_SERVICE_BROKEN
! if (service_port) for (ai = *result; ai; ai = ai->ai_next) {
if (socket_type != 0 && ai->ai_socktype == 0)
/* Is this check actually needed? */
ai->ai_socktype = socket_type;
From: raeburn@mit.edu
Subject: CVS Commit
* fake-addrinfo.h (getaddrinfo) [NUMERIC_SERVICE_BROKEN]: Overwrite the port
number only if a numeric service port was supplied.


To generate a diff of this commit:



cvs diff -r1.350 -r1.351 krb5/src/include/ChangeLog
cvs diff -r1.35 -r1.36 krb5/src/include/fake-addrinfo.h
From: tlyu@mit.edu
Subject: CVS Commit
pullup from trunk


To generate a diff of this commit:



cvs diff -r1.348.2.1 -r1.348.2.2 krb5/src/include/ChangeLog
cvs diff -r1.34 -r1.34.2.1 krb5/src/include/fake-addrinfo.h