diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2011-06-16 16:55:58 (GMT) |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2011-06-16 16:55:58 (GMT) |
commit | e6146e8684ed6dd4c0ff85ca21bf4324114fbbfa (patch) | |
tree | 31ca70199cdfeb5705a119a510414704c64f0f3e /include/linux/netfilter/ipset | |
parent | f3dfd1538f26f1ecf86daaf3d0c321d87e5de041 (diff) | |
download | linux-fsl-qoriq-e6146e8684ed6dd4c0ff85ca21bf4324114fbbfa.tar.xz |
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>
Diffstat (limited to 'include/linux/netfilter/ipset')
-rw-r--r-- | include/linux/netfilter/ipset/pfxlen.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/netfilter/ipset/pfxlen.h b/include/linux/netfilter/ipset/pfxlen.h index 84efa33..d55a6cc 100644 --- a/include/linux/netfilter/ipset/pfxlen.h +++ b/include/linux/netfilter/ipset/pfxlen.h @@ -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 */ |