netdb.h: fix prototype of gethostbyaddr()

first parameter should be const void*, in line with freebsd and linux etc.

https://xref.landonf.org/source/xref/freebsd-current/include/netdb.h#232

Change-Id: I5e953e8e7e49a6f09cd1143de6ca57eb98f77d73
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3147
Reviewed-by: Michael Lotz <mmlr@mlotz.ch>
This commit is contained in:
rofl0r 2020-08-15 01:26:39 +01:00 committed by Michael Lotz
parent c367ace2ae
commit 7de1ebe0d6
2 changed files with 2 additions and 3 deletions

View File

@ -195,7 +195,7 @@ void endnetent(void);
void endprotoent(void);
void endservent(void);
void freehostent(struct hostent *host);
struct hostent *gethostbyaddr(const char *address, socklen_t length, int type);
struct hostent *gethostbyaddr(const void *address, socklen_t length, int type);
struct hostent *gethostbyname(const char *name);
struct hostent *gethostbyname2(const char *name, int type);
struct hostent *gethostent(void);

View File

@ -669,7 +669,7 @@ gethostbyname_internal(const char *name, int af, res_state res)
}
struct hostent *
gethostbyaddr(const char *addr, /* XXX should have been def'd as u_char! */
gethostbyaddr(const void *addr,
socklen_t len, int af)
{
const u_char *uaddr = (const u_char *)addr;
@ -694,7 +694,6 @@ gethostbyaddr(const char *addr, /* XXX should have been def'd as u_char! */
(IN6_IS_ADDR_V4MAPPED((const struct in6_addr *)(const void *)uaddr) ||
IN6_IS_ADDR_V4COMPAT((const struct in6_addr *)(const void *)uaddr))) {
/* Unmap. */
addr += IN6ADDRSZ - INADDRSZ;
uaddr += IN6ADDRSZ - INADDRSZ;
af = AF_INET;
len = INADDRSZ;