aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/ipset/ip_set_bitmap_ip.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/netfilter/ipset/ip_set_bitmap_ip.c')
-rw-r--r--net/netfilter/ipset/ip_set_bitmap_ip.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/netfilter/ipset/ip_set_bitmap_ip.c b/net/netfilter/ipset/ip_set_bitmap_ip.c
index 49323110560..c46e3440159 100644
--- a/net/netfilter/ipset/ip_set_bitmap_ip.c
+++ b/net/netfilter/ipset/ip_set_bitmap_ip.c
@@ -283,8 +283,7 @@ bitmap_ip_uadt(struct ip_set *set, struct nlattr *tb[],
283 283
284 if (cidr > 32) 284 if (cidr > 32)
285 return -IPSET_ERR_INVALID_CIDR; 285 return -IPSET_ERR_INVALID_CIDR;
286 ip &= ip_set_hostmask(cidr); 286 ip_set_mask_from_to(ip, ip_to, cidr);
287 ip_to = ip | ~ip_set_hostmask(cidr);
288 } else 287 } else
289 ip_to = ip; 288 ip_to = ip;
290 289
@@ -478,8 +477,7 @@ bitmap_ip_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
478 477
479 if (cidr >= 32) 478 if (cidr >= 32)
480 return -IPSET_ERR_INVALID_CIDR; 479 return -IPSET_ERR_INVALID_CIDR;
481 first_ip &= ip_set_hostmask(cidr); 480 ip_set_mask_from_to(first_ip, last_ip, cidr);
482 last_ip = first_ip | ~ip_set_hostmask(cidr);
483 } else 481 } else
484 return -IPSET_ERR_PROTOCOL; 482 return -IPSET_ERR_PROTOCOL;
485 483