Mailing List Archive

AIX- 'Host not found' in getaddrinfo("0.0.0.0", "22" , ...)
Hello,
while openssh-1.2.1pre25 ran out-of-the box, in openssh-1.2.1pre27 the
sshd fails to start with: "Host not found" returned...
(gcc 2.9.5.2 under AIX 4.3.2 ML 2)

Incompatibility of AIX-getaddrinfo ????
Since I'm not familiar with getaddrinfo, I've got no idea what goes wrong
??? Does the code below work on other architectures?

Demo-Code built with values taken from a debug-session:
=======================================================
#include <stdio.h>
#include <sys/socket.h>
#include <netdb.h>

void main (void) {

struct addrinfo hints;
struct addrinfo *res;
int gaierr;

hints.ai_family = AF_UNSPEC;
hints.ai_flags = 0;
hints.ai_flags = 0;
hints.ai_family = 0;
hints.ai_socktype = 1; /* = SOCK_STREAM; */
hints.ai_protocol = 0;
hints.ai_addrlen = 0;
hints.ai_canonname = 0x0;
hints.ai_addr = 0x0;
hints.ai_next = 0x0;

gaierr = getaddrinfo("0.0.0.0", "22" , &hints, &res);

printf("gaierr=%i (=%s)\n",gaierr,gai_strerror(gaierr));
}
Re: AIX- 'Host not found' in getaddrinfo("0.0.0.0", "22" , ...) [ In reply to ]
> while openssh-1.2.1pre25 ran out-of-the box, in openssh-1.2.1pre27 the
> sshd fails to start with: "Host not found" returned...
> (gcc 2.9.5.2 under AIX 4.3.2 ML 2)

I can't duplicate this, although I'm using the AIX native compiler. I have
found a couple issues with pre27 release.

Quick fix, the config.h.in file, please change

#endif _CONFIG_H

to

#endif /* _CONFIG_H */

There's also a problem with u_int8_t, as defined within fake-socket.h, I'll
try to prepare a patch later today. As a quick fix to get it to compile, I
defined u_int8_t to unsigned char, Stevens had some autoconf rules to get
a relatively portable listing of types.

> Incompatibility of AIX-getaddrinfo ????

I'm noticing that this dist has a fake-getaddrinfo, you're using AIX's
native
version on 4.3.2? In 4.2.1, the fake version seems defined when I
compiled.
Did you run ./configure --enable-ipv6 (which would definitely not use the
pre-packaged version)?
Re: AIX- 'Host not found' in getaddrinfo("0.0.0.0", "22" , ...) [ In reply to ]
On Tue, Jan 18, 2000 at 11:33:12AM +0100, "Petersen, Jörg" wrote:
> Hello,
> while openssh-1.2.1pre25 ran out-of-the box, in openssh-1.2.1pre27 the
> sshd fails to start with: "Host not found" returned...
> (gcc 2.9.5.2 under AIX 4.3.2 ML 2)

> Incompatibility of AIX-getaddrinfo ????
> Since I'm not familiar with getaddrinfo, I've got no idea what goes wrong
> ??? Does the code below work on other architectures?

Accepting "0.0.0.0" is a hack, not a "standard behaviour" for UNIX-like
OSes. I know that NetBSD has become less accepting of 0.0.0.0 as an
"all addresses" alias.

Is ListenAddress 0.0.0.0 a no-op? It looks like it is, but I don't have
a multi-interface machine on which I can check. If it's not, then maybe
we need to make people specify all ListenAddress'es or maybe we need to
let the default be to listen on all addresses unless a ListenAddress is
specified, and then it won't listen to any other source address.

David

--
David W. Rankin, Jr. Husband, Father, and UNIX Sysadmin.
Email: drankin@bohemians.lexington.ky.us Address/Phone Number: Ask me.
"It is no great thing to be humble when you are brought low; but to be humble
when you are praised is a great and rare accomplishment." St. Bernard
RE: AIX- 'Host not found' in getaddrinfo("0.0.0.0", "22" , ...) [ In reply to ]
Thanks for all answers.

Here my summary/solution:
./configure --with-egd-pool=/usr/local/etc/entropy-for-openssh
on AIX uses the getaddrinfo shipped with AIX.
Somehow this doesn't work -
neither with 0.0.0.0 nor with a real IP-Adress....

Commenting out
/* #define HAVE_GETADDRINFO 1 */
in config.h uses the fake-getnameinfo.c-Version which works.


This leaves the Question:
a) is the AIX-getaddrinfo wrong
or
b) is the call to getaddrinfo by openssh wrong?

Joerg Petersen
Re: AIX- 'Host not found' in getaddrinfo("0.0.0.0", "22" , ...) [ In reply to ]
On Tue, 18 Jan 2000, Petersen, Jörg wrote:

> Hello,
> while openssh-1.2.1pre25 ran out-of-the box, in openssh-1.2.1pre27 the
> sshd fails to start with: "Host not found" returned...
> (gcc 2.9.5.2 under AIX 4.3.2 ML 2)
>
> Incompatibility of AIX-getaddrinfo ????
> Since I'm not familiar with getaddrinfo, I've got no idea what goes wrong
> ??? Does the code below work on other architectures?

Does AIX define its own getaddrinfo or does it use the replacement
functions?

Damien

--
| "Bombay is 250ms from New York in the new world order" - Alan Cox
| Damien Miller - http://www.mindrot.org/
| Email: djm@mindrot.org (home) -or- djm@ibs.com.au (work)