Hi Matthew,

On Fri, Aug 19, 2005 at 11:26:06AM +1000, Matthew Sanderson wrote:
> Neon 0.24.7 (bundled into SVN) was failing to do any name lookups
> successfully when compiled by a 64-bit GCC running on HPUX 11.11 on HPPA.
> I think it would exhibit this problem on other LP64 systems too. The
> following patch fixes it for me:

Thanks for the patch Matthew, this looks good.

> diff -Naur neon-0.24.7/src/ne_socket.orig.c neon-0.24.7/src/ne_socket.c
> --- neon-0.24.7/src/ne_socket.orig.c    2005-07-01 16:18:39.000000000
> -0400
> +++ neon-0.24.7/src/ne_socket.c 2005-08-16 04:33:59.000000000 -0400
> @@ -670,7 +670,7 @@
>  #endif
>      }
>  #else /* Use gethostbyname() */
> -    unsigned long laddr;
> +    in_addr_t laddr;
>      struct hostent *hp;
> 
>      laddr = inet_addr(hostname);
> 
> Ie, the assumption that unsigned long is 32 bits wide does not hold in an
> LP64 environment (by definition).
> 
> A quick poll of some UNIX boxes shows that this 'in_addr_t' type is used
> for the return type of 'inet_addr' under Linux, Tru64 and HPUX, but not
> under SCO OpenServer or (surprisingly to me) under Solaris 7, which use
> 'unsigned long'. So I suppose it needs an extra autoconf test?

Yup, just a simple AC_CHECK_TYPE will do it; I've added this.

> Solaris 7 runs on 64-bit SPARC chips, so I don't understand how this works
> on that OS. Is it going to return a 64-bit long with the inet addr in the
> low 32 bits? Ugh. I haven't investigated this but I can if useful.

Recentish Solarises (and the majority of 64-bit Unixes) will have 
getaddrinfo() support enabled, so they don't use this code at all, 
fortunately ;)

Regards,

joe
_______________________________________________
neon mailing list
[email protected]
http://mailman.webdav.org/mailman/listinfo/neon

Reply via email to