diff --git a/libc/include/netinet/icmp6.h b/libc/include/netinet/icmp6.h index c5297e9e2..5a0293d6b 100644 --- a/libc/include/netinet/icmp6.h +++ b/libc/include/netinet/icmp6.h @@ -533,18 +533,28 @@ struct icmp6_filter { u_int32_t icmp6_filt[8]; }; +/* + * BEGIN android-changed + * Linux and *BSD kernels use opposite values to indicate pass/block in ICMPv6 + * filters, and assign a different value to the ICMP6_FILTER sockopt. + */ +#define ICMP6_FILTER 1 + #define ICMP6_FILTER_SETPASSALL(filterp) \ - (void)memset(filterp, 0xff, sizeof(struct icmp6_filter)) -#define ICMP6_FILTER_SETBLOCKALL(filterp) \ (void)memset(filterp, 0x00, sizeof(struct icmp6_filter)) +#define ICMP6_FILTER_SETBLOCKALL(filterp) \ + (void)memset(filterp, 0xff, sizeof(struct icmp6_filter)) #define ICMP6_FILTER_SETPASS(type, filterp) \ - (((filterp)->icmp6_filt[(type) >> 5]) |= (1 << ((type) & 31))) -#define ICMP6_FILTER_SETBLOCK(type, filterp) \ (((filterp)->icmp6_filt[(type) >> 5]) &= ~(1 << ((type) & 31))) +#define ICMP6_FILTER_SETBLOCK(type, filterp) \ + (((filterp)->icmp6_filt[(type) >> 5]) |= (1 << ((type) & 31))) #define ICMP6_FILTER_WILLPASS(type, filterp) \ - ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) != 0) -#define ICMP6_FILTER_WILLBLOCK(type, filterp) \ ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) == 0) +#define ICMP6_FILTER_WILLBLOCK(type, filterp) \ + ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) != 0) +/* + * END android-changed + */ /* * Variables related to this implementation