Merge "Fix IPv6 filtering definitions in netinet/icmp6.h."
This commit is contained in:
commit
6b33f31b09
1 changed files with 16 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue