Skip Menu |
 

Subject: HPUX 11.22 getaddrinfo() issues
Date: Thu, 26 Jan 2006 16:20:42 -0800
From: "Nate Yocom" <nate.yocom@centrify.com>
To: <krb5-bugs@mit.edu>
The attached patch fixes the following getaddrinfo() related issues:

- Despite being given both a host and service name, getaddrinfo() on
HPUX 11.22 sometimes returns EAI_NONAME. To fix, the patch adds a check
for gethostbyname and getservbyname and falls back on them in the case
of HPUX and a return of EAI_NONAME.

- Memory leak, if getaddrinfo() succeeds, we need to free the result
before leaving with freeaddrinfo()

Nate Yocom
Senior Software Engineer
Centrify Corporation
425.462.5894
www.centrify.com
Download bad_getaddrinfo_fallback.diff
application/octet-stream 24.3KiB

Message body not shown because it is not plain text.


Show quoted text
> - Despite being given both a host and service name, getaddrinfo() on
> HPUX 11.22 sometimes returns EAI_NONAME. To fix, the patch adds a check
> for gethostbyname and getservbyname and falls back on them in the case
> of HPUX and a return of EAI_NONAME.

Rather than make lots of different bits of code work with both
getaddrinfo and gethostbyname, we've implemented a wrapper around the
getaddrinfo interface which patches up bogus results (e.g., sa_len field
unset on AIX) and implements the functionality if the OS doesn't provide
getaddrinfo at all (old IRIX systems we've still got lying around here).
That would be the right place to fix this, I think, rather than just in
the telnet client program. (If it breaks for telnet, why not for the
library attempting to contact the KDC?)

Also, is this random flakiness, or is it a consistent problem caused by
incorrect configuration (e.g., if getaddrinfo uses different config
data, like a different nsswitch entry, from gethostbyname)?
Subject: RE: [krbdev.mit.edu #3421] HPUX 11.22 getaddrinfo() issues
Date: Mon, 19 Jun 2006 11:45:10 -0700
From: "Nate Yocom" <nate.yocom@centrify.com>
To: <rt-comment@krbdev.mit.edu>
RT-Send-Cc:
Show quoted text
> That would be the right place to fix this, I think, rather
> than just in the telnet client program. (If it breaks for
> telnet, why not for the library attempting to contact the KDC?)

I agree the new wrapper is the best place to fix this.

Show quoted text
> Also, is this random flakiness, or is it a consistent problem
> caused by incorrect configuration (e.g., if getaddrinfo uses
> different config data, like a different nsswitch entry, from
> gethostbyname)?

This appears through testing to be a bug or issue in the HPUX 11.22
getaddrinfo() call when provided the service name "telnet" and hostname
"localhost", despite an /etc/host entry (and appropriate nsswitch.conf
config) with:

127.0.0.1 localhost.localdomain localhost loopback

getaddrinfo() consitently returns EAI_NONAME in this case, which is
documented as indicating that either a hostname or service was not
provided, which is incorrect.

Hope that helps,
Nate