From bba6bcb29f69831ab0e50a85d95884ce31293174 Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Sun, 22 May 2011 12:18:36 +0200 Subject: Take into account cidr value for the from address when creating the set When creating a set from a range expressed as a network like 10.1.1.172/29, the from address was taken as the IP address part and not masked with the netmask from the cidr. --- kernel/net/netfilter/ipset/ip_set_bitmap_ip.c | 1 + 1 file changed, 1 insertion(+) (limited to 'kernel/net/netfilter') diff --git a/kernel/net/netfilter/ipset/ip_set_bitmap_ip.c b/kernel/net/netfilter/ipset/ip_set_bitmap_ip.c index 3b5920b..4932311 100644 --- a/kernel/net/netfilter/ipset/ip_set_bitmap_ip.c +++ b/kernel/net/netfilter/ipset/ip_set_bitmap_ip.c @@ -478,6 +478,7 @@ bitmap_ip_create(struct ip_set *set, struct nlattr *tb[], u32 flags) if (cidr >= 32) return -IPSET_ERR_INVALID_CIDR; + first_ip &= ip_set_hostmask(cidr); last_ip = first_ip | ~ip_set_hostmask(cidr); } else return -IPSET_ERR_PROTOCOL; -- cgit v1.2.3