diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2014-11-30 13:56:56 -0500 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-12-03 06:43:36 -0500 |
commit | 77b4311d207c3ed7260da840ba41afa8bd9ca24c (patch) | |
tree | e922eb35a141a9803ed49c2de09788392d8175b1 | |
parent | 25a76f3463e0424fdf85773afb4be4972b1c0a29 (diff) |
netfilter: ipset: Allocate the proper size of memory when /0 networks are supported
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | net/netfilter/ipset/ip_set_hash_gen.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/netfilter/ipset/ip_set_hash_gen.h b/net/netfilter/ipset/ip_set_hash_gen.h index 8ef9135d8bb5..974ff386db0f 100644 --- a/net/netfilter/ipset/ip_set_hash_gen.h +++ b/net/netfilter/ipset/ip_set_hash_gen.h | |||
@@ -1101,8 +1101,7 @@ IPSET_TOKEN(HTYPE, _create)(struct net *net, struct ip_set *set, | |||
1101 | 1101 | ||
1102 | hsize = sizeof(*h); | 1102 | hsize = sizeof(*h); |
1103 | #ifdef IP_SET_HASH_WITH_NETS | 1103 | #ifdef IP_SET_HASH_WITH_NETS |
1104 | hsize += sizeof(struct net_prefixes) * | 1104 | hsize += sizeof(struct net_prefixes) * NLEN(set->family); |
1105 | (set->family == NFPROTO_IPV4 ? 32 : 128); | ||
1106 | #endif | 1105 | #endif |
1107 | h = kzalloc(hsize, GFP_KERNEL); | 1106 | h = kzalloc(hsize, GFP_KERNEL); |
1108 | if (!h) | 1107 | if (!h) |