diff options
author | ume <ume@FreeBSD.org> | 2006-05-12 15:37:23 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2006-05-12 15:37:23 +0000 |
commit | ab3eacdf3106cb0b4027a6d928d9555815af0b48 (patch) | |
tree | 164cb97bf2cd0fc04b8135b782152c0960ca3354 /lib/libc/net/gethostbydns.c | |
parent | 08978d5bee9bfc81ae25a6b3a8971577532cc9aa (diff) | |
download | FreeBSD-src-ab3eacdf3106cb0b4027a6d928d9555815af0b48.zip FreeBSD-src-ab3eacdf3106cb0b4027a6d928d9555815af0b48.tar.gz |
Fix gethostbyaddr() prototype to conform to IEEE Std 1003.1:
http://www.opengroup.org/onlinepubs/009695399/functions/gethostbyaddr.html
gethostbyaddr_r() is changed as well.
It breaks ABI backward compatibility on 64 bit arch. So, we fix it
on 32 bit arch only for now.
Reported by: Rostislav Krasny <rosti.bsd@gmail.com>
Diffstat (limited to 'lib/libc/net/gethostbydns.c')
-rw-r--r-- | lib/libc/net/gethostbydns.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/libc/net/gethostbydns.c b/lib/libc/net/gethostbydns.c index 8558513..b19dc79 100644 --- a/lib/libc/net/gethostbydns.c +++ b/lib/libc/net/gethostbydns.c @@ -550,11 +550,13 @@ _dns_gethostbyname(void *rval, void *cb_data, va_list ap) int _dns_gethostbyaddr(void *rval, void *cb_data, va_list ap) { - const u_char *uaddr; - int len, af; + const void *addr; + socklen_t len; + int af; char *buffer; size_t buflen; int *errnop, *h_errnop; + const u_char *uaddr; struct hostent *hptr, he; struct hostent_data *hed; int n; @@ -570,14 +572,15 @@ _dns_gethostbyaddr(void *rval, void *cb_data, va_list ap) int ret_h_error; #endif /*SUNSECURITY*/ - uaddr = va_arg(ap, const u_char *); - len = va_arg(ap, int); + addr = va_arg(ap, const void *); + len = va_arg(ap, socklen_t); af = va_arg(ap, int); hptr = va_arg(ap, struct hostent *); buffer = va_arg(ap, char *); buflen = va_arg(ap, size_t); errnop = va_arg(ap, int *); h_errnop = va_arg(ap, int *); + uaddr = (const u_char *)addr; *((struct hostent **)rval) = NULL; |