On 16 Apr 2002, Arkadiusz Miskiewicz wrote:
> This
>
> +22. Arranged to use getipnodebyaddr() instead of gethostbyaddr() in systems
> + with IPv6 support that have this function, because gethostbyaddr() doesn't
> + work for IPv6 addresses on all systems (it does on some).
>
> --- exim-4.02/OS/os.h-Linux Mon Mar 25 12:09:42 2002
> +++ exim-4.03/OS/os.h-Linux Tue Apr 16 12:40:58 2002
> @@ -11,6 +11,9 @@
> #define F_FREESP O_TRUNC
> typedef struct flock flock_t;
>
> +#define HAVE_GETIPNODEBYNAME 1
> +#define HAVE_GETIPNODEBYADDR 1
> +
> #define os_strsignal strsignal
> #define OS_STRSIGNAL
>
> broke linux. There is no getipnodebyxxxx() in glibc and never be.
> getipnodebyxxxx() are obsolete in favour of get(addr|name)info().
I DID check. I logged onto a Linux box and ran "man getipnodebyaddr". I
got this:
------------------------------------------------------------------
getipnodebyname(3) Linux Programmer's Manual getipnodebyname(3)
NAME
getipnodebyname, getipnodebyaddr, freehostent - get net-
work host names and addresses
SYNOPSIS
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
struct hostent *getipnodebyname(const char *name,
int af, int flags,
int *error_num);
struct hostent *getipnodebyaddr(const void *addr,
size_t len, int af,
int *error_num);
------------------------------------------------------------------
So there certainly was getipnodebyaddr at some stage. The spec was much
the same as the Solaris version.
> Please revert this change.
I was asked to make this change because (someone asserted) gethostbyaddr
in Linux doesn't work with IPv6 addresses. (It works fine in Solaris.)
So, folks, I don't know what to do here. I have conflicting information
coming at me. What is the real story?
Meanwhile, you can set HAVE_GETIPNODEBYADDR to 0 to make Exim not try to
use it.
> ps. getaddrinfo internally uses gethostbyname2() while getnameinfo() uses
> gethostbyaddr() + gethostbyname() in glibc.
Why are there so darn many of these functions? I had heard of
gethostbyname2(), but I think that is obsolete. Solaris doesn't have it.
I haven't previously heard of get{addr,name}info().
Looks like I'll have to invent HAVE_GETADDRINFO and HAVE_GETNAMEINFO.
Sigh.
--
Philip Hazel University of Cambridge Computing Service,
ph10@??? Cambridge, England. Phone: +44 1223 334714.