diff options
Diffstat (limited to 'kernel/ip_set_hash_ipportip.c')
-rw-r--r-- | kernel/ip_set_hash_ipportip.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/kernel/ip_set_hash_ipportip.c b/kernel/ip_set_hash_ipportip.c index bad0337..37a09f8 100644 --- a/kernel/ip_set_hash_ipportip.c +++ b/kernel/ip_set_hash_ipportip.c @@ -138,13 +138,13 @@ nla_put_failure: #define PF 4 #define HOST_MASK 32 -#include <linux/netfilter/ipset/ip_set_chash.h> +#include <linux/netfilter/ipset/ip_set_ahash.h> static int hash_ipportip4_kadt(struct ip_set *set, const struct sk_buff *skb, enum ipset_adt adt, u8 pf, u8 dim, u8 flags) { - struct chash *h = set->data; + struct ip_set_hash *h = set->data; ipset_adtfn adtfn = set->variant->adt[adt]; struct hash_ipportip4_elem data = { }; @@ -172,7 +172,7 @@ static int hash_ipportip4_uadt(struct ip_set *set, struct nlattr *head, int len, enum ipset_adt adt, u32 *lineno, u32 flags) { - struct chash *h = set->data; + struct ip_set_hash *h = set->data; struct nlattr *tb[IPSET_ATTR_ADT_MAX+1]; ipset_adtfn adtfn = set->variant->adt[adt]; struct hash_ipportip4_elem data = { }; @@ -231,14 +231,12 @@ hash_ipportip4_uadt(struct ip_set *set, struct nlattr *head, int len, static bool hash_ipportip_same_set(const struct ip_set *a, const struct ip_set *b) { - struct chash *x = a->data; - struct chash *y = b->data; + struct ip_set_hash *x = a->data; + struct ip_set_hash *y = b->data; /* Resizing changes htable_bits, so we ignore it */ return x->maxelem == y->maxelem - && x->timeout == y->timeout - && x->array_size == y->array_size - && x->chain_limit == y->chain_limit; + && x->timeout == y->timeout; } /* The type variant functions: IPv6 */ @@ -338,13 +336,13 @@ nla_put_failure: #define PF 6 #define HOST_MASK 128 -#include <linux/netfilter/ipset/ip_set_chash.h> +#include <linux/netfilter/ipset/ip_set_ahash.h> static int hash_ipportip6_kadt(struct ip_set *set, const struct sk_buff *skb, enum ipset_adt adt, u8 pf, u8 dim, u8 flags) { - struct chash *h = set->data; + struct ip_set_hash *h = set->data; ipset_adtfn adtfn = set->variant->adt[adt]; struct hash_ipportip6_elem data = { }; @@ -362,7 +360,7 @@ static int hash_ipportip6_uadt(struct ip_set *set, struct nlattr *head, int len, enum ipset_adt adt, u32 *lineno, u32 flags) { - struct chash *h = set->data; + struct ip_set_hash *h = set->data; struct nlattr *tb[IPSET_ATTR_ADT_MAX+1]; ipset_adtfn adtfn = set->variant->adt[adt]; struct hash_ipportip6_elem data = { }; @@ -434,7 +432,7 @@ hash_ipportip_create(struct ip_set *set, struct nlattr *head, int len, u32 flags) { struct nlattr *tb[IPSET_ATTR_CREATE_MAX+1]; - struct chash *h; + struct ip_set_hash *h; u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; u8 hbits; @@ -459,15 +457,13 @@ hash_ipportip_create(struct ip_set *set, struct nlattr *head, return -ENOMEM; h->maxelem = maxelem; - h->array_size = CHASH_DEFAULT_ARRAY_SIZE; - h->chain_limit = CHASH_DEFAULT_CHAIN_LIMIT; get_random_bytes(&h->initval, sizeof(h->initval)); h->timeout = IPSET_NO_TIMEOUT; hbits = htable_bits(hashsize); h->table = ip_set_alloc( sizeof(struct htable) - + jhash_size(hbits) * sizeof(struct slist), + + jhash_size(hbits) * sizeof(struct hbucket), GFP_KERNEL); if (!h->table) { kfree(h); |