netfilter: ipset: use unified from/to address masking and check the usage
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
committed by
Patrick McHardy
parent
f3dfd1538f
commit
e6146e8684
@@ -35,4 +35,10 @@ ip_set_hostmask6(u8 pfxlen)
|
||||
|
||||
extern u32 ip_set_range_to_cidr(u32 from, u32 to, u8 *cidr);
|
||||
|
||||
#define ip_set_mask_from_to(from, to, cidr) \
|
||||
do { \
|
||||
from &= ip_set_hostmask(cidr); \
|
||||
to = from | ~ip_set_hostmask(cidr); \
|
||||
} while (0)
|
||||
|
||||
#endif /*_PFXLEN_H */
|
||||
|
||||
Reference in New Issue
Block a user