summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2014-10-03 07:06:00 +0200
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2014-10-20 23:13:37 +0200
commit897af99ede65da9aedb8686851f4b61a87dfb330 (patch)
treee36e09630005b9b2cd879ab45165875f2cb9d69b
parent4ad28781b89666259f21abc9508e056b8ba96c50 (diff)
downloadipset-897af99ede65da9aedb8686851f4b61a87dfb330.tar.gz
Allocate the proper size of memory when /0 networks are supported
-rw-r--r--kernel/net/netfilter/ipset/ip_set_hash_gen.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/kernel/net/netfilter/ipset/ip_set_hash_gen.h b/kernel/net/netfilter/ipset/ip_set_hash_gen.h
index e19105b..6580b7e 100644
--- a/kernel/net/netfilter/ipset/ip_set_hash_gen.h
+++ b/kernel/net/netfilter/ipset/ip_set_hash_gen.h
@@ -1101,8 +1101,7 @@ IPSET_TOKEN(HTYPE, _create)(struct net *net, struct ip_set *set,
hsize = sizeof(*h);
#ifdef IP_SET_HASH_WITH_NETS
- hsize += sizeof(struct net_prefixes) *
- (set->family == NFPROTO_IPV4 ? 32 : 128);
+ hsize += sizeof(struct net_prefixes) * NLEN(set->family);
#endif
h = kzalloc(hsize, GFP_KERNEL);
if (!h)