Skip to content

Commit

Permalink
netfilter: ipset: Allocate the proper size of memory when /0 networks…
Browse files Browse the repository at this point in the history
… are supported

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Jozsef Kadlecsik authored and Pablo Neira Ayuso committed Dec 3, 2014
1 parent 25a76f3 commit 77b4311
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/netfilter/ipset/ip_set_hash_gen.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 77b4311

Please sign in to comment.