diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2011-05-23 10:56:14 +0200 |
---|---|---|
committer | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2011-05-23 10:56:14 +0200 |
commit | 9a84755e05850a1faab80b5c4b5e5449f9c3c88d (patch) | |
tree | 4b851e7c816f61f324d9378fc4ac6203eb6cca51 /kernel/include | |
parent | 6b71deec45bd5cd40df92a7ebca2a6666cda203b (diff) |
Use unified from/to address masking and check the usage
Diffstat (limited to 'kernel/include')
-rw-r--r-- | kernel/include/linux/netfilter/ipset/pfxlen.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/include/linux/netfilter/ipset/pfxlen.h b/kernel/include/linux/netfilter/ipset/pfxlen.h index 84efa33..d55a6cc 100644 --- a/kernel/include/linux/netfilter/ipset/pfxlen.h +++ b/kernel/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 */ |