summaryrefslogtreecommitdiff
path: root/net/netfilter/ipset/ip_set_hash_ip.c
diff options
context:
space:
mode:
authorSergey Popovich <popovich_sergei@mail.ua>2015-05-02 19:28:11 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2015-05-13 13:25:47 +0200
commitcabfd139aa9863ebafe0bbba3f203d0c4e43e2cf (patch)
treeb29fb123f91ab8f53b49abe0c11df94fceb7a585 /net/netfilter/ipset/ip_set_hash_ip.c
parentd25472e4706329f595377aca38ccb664bdd14531 (diff)
netfilter: ipset: Use HOST_MASK literal to represent host address CIDR len
Signed-off-by: Sergey Popovich <popovich_sergei@mail.ua> Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/ipset/ip_set_hash_ip.c')
-rw-r--r--net/netfilter/ipset/ip_set_hash_ip.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/ipset/ip_set_hash_ip.c b/net/netfilter/ipset/ip_set_hash_ip.c
index 1c469df60551..1a9ef0c6d457 100644
--- a/net/netfilter/ipset/ip_set_hash_ip.c
+++ b/net/netfilter/ipset/ip_set_hash_ip.c
@@ -147,7 +147,7 @@ hash_ip4_uadt(struct ip_set *set, struct nlattr *tb[],
} else if (tb[IPSET_ATTR_CIDR]) {
u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]);
- if (!cidr || cidr > 32)
+ if (!cidr || cidr > HOST_MASK)
return -IPSET_ERR_INVALID_CIDR;
ip_set_mask_from_to(ip, ip_to, cidr);
}