From f5af89cdeebe81df1400c2f8b6c360148907f6d8 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Fri, 6 Jul 2001 06:13:19 +0000 Subject: [PATCH] IN6_ARE_ADDR_EQUAL and IN6_IS_ADDR_UNSPECIFIED are broken in glibc 2.1 --- lib/bind/port_after.h.in | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/bind/port_after.h.in b/lib/bind/port_after.h.in index a4684ef0a1..b4acdbca6f 100644 --- a/lib/bind/port_after.h.in +++ b/lib/bind/port_after.h.in @@ -132,6 +132,17 @@ struct sockaddr_storage { extern const struct in6_addr in6addr_any; #endif +/* + * IN6_ARE_ADDR_EQUAL and IN6_IS_ADDR_UNSPECIFIED are broken in at least + * 2.1. The macros incorrectly cast away const. + */ +#ifdef __GLIBC__ +#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 2) +#undef IN6_ARE_ADDR_EQUAL +#undef IN6_IS_ADDR_UNSPECIFIED +#endif +#endif + #ifndef IN6_ARE_ADDR_EQUAL #define IN6_ARE_ADDR_EQUAL(a,b) \ (memcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0)