From 9a84755e05850a1faab80b5c4b5e5449f9c3c88d Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Mon, 23 May 2011 10:56:14 +0200 Subject: Use unified from/to address masking and check the usage --- kernel/include/linux/netfilter/ipset/pfxlen.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'kernel/include') 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 */ -- cgit v1.2.3