From 4f7c1aab10f5393f5b56def4c1166f1d97312184 Mon Sep 17 00:00:00 2001 From: JP Abgrall Date: Wed, 18 May 2011 16:53:23 -0700 Subject: [PATCH] DO NOT MERGE: libc: enable IPTOS_MINCOST, fixup gethostbyaddr() proto. DO NOT MERGE: pulled in from master for iptables v1.4.11 update Make netinet/ip.h have IPTOS_MINCOST which matches what kernel/common/linux/ip.h has to say. Fixup gethostbyaddr() 1st arg to match what man has to say. Change-Id: Iff9647d4a46ea88b1fc32163eb69bb9b27cdf370 --- libc/include/netdb.h | 4 ++-- libc/include/netinet/ip.h | 2 +- libc/netbsd/gethnamaddr.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libc/include/netdb.h b/libc/include/netdb.h index c2e08ea87..949136455 100644 --- a/libc/include/netdb.h +++ b/libc/include/netdb.h @@ -209,8 +209,8 @@ void endnetgrent(void); void endprotoent(void); void endservent(void); void freehostent(struct hostent *); -struct hostent *gethostbyaddr(const char *, int, int); -int gethostbyaddr_r(const char *, int, int, struct hostent *, char *, size_t, struct hostent **, int *); +struct hostent *gethostbyaddr(const void *, int, int); +int gethostbyaddr_r(const void *, int, int, struct hostent *, char *, size_t, struct hostent **, int *); struct hostent *gethostbyname(const char *); int gethostbyname_r(const char *, struct hostent *, char *, size_t, struct hostent **, int *); struct hostent *gethostbyname2(const char *, int); diff --git a/libc/include/netinet/ip.h b/libc/include/netinet/ip.h index 541905c13..629ed77b0 100644 --- a/libc/include/netinet/ip.h +++ b/libc/include/netinet/ip.h @@ -83,7 +83,7 @@ struct ip { #define IPTOS_LOWDELAY 0x10 #define IPTOS_THROUGHPUT 0x08 #define IPTOS_RELIABILITY 0x04 -/* IPTOS_LOWCOST 0x02 XXX */ +#define IPTOS_MINCOST 0x02 #if 1 /* ECN RFC3168 obsoletes RFC2481, and these will be deprecated soon. */ #define IPTOS_CE 0x01 /* congestion experienced */ diff --git a/libc/netbsd/gethnamaddr.c b/libc/netbsd/gethnamaddr.c index 3ebe53e2c..fb1886969 100644 --- a/libc/netbsd/gethnamaddr.c +++ b/libc/netbsd/gethnamaddr.c @@ -637,7 +637,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;