diff options
Diffstat (limited to 'kernel/ip_set_hash_ipport.c')
-rw-r--r-- | kernel/ip_set_hash_ipport.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/kernel/ip_set_hash_ipport.c b/kernel/ip_set_hash_ipport.c index 22397fb..1a9cd39 100644 --- a/kernel/ip_set_hash_ipport.c +++ b/kernel/ip_set_hash_ipport.c @@ -133,13 +133,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_ipport4_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_ipport4_elem data = { }; @@ -165,7 +165,7 @@ static int hash_ipport4_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_ipport4_elem data = { }; @@ -220,14 +220,12 @@ hash_ipport4_uadt(struct ip_set *set, struct nlattr *head, int len, static bool hash_ipport_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 */ @@ -322,13 +320,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_ipport6_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_ipport6_elem data = { }; @@ -345,7 +343,7 @@ static int hash_ipport6_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_ipport6_elem data = { }; @@ -413,7 +411,7 @@ static int hash_ipport_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; @@ -438,15 +436,13 @@ hash_ipport_create(struct ip_set *set, struct nlattr *head, int len, u32 flags) 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); |