1
0
Fork 0

netfilter: ipset: Fix hashing for ipv6 sets

HKEY_DATALEN remains defined after first inclusion
of ip_set_hash_gen.h, so it is incorrectly reused
for IPv6 code.

Undefine HKEY_DATALEN in ip_set_hash_gen.h at the end.

Also remove some useless defines of HKEY_DATALEN in
ip_set_hash_{ip{,mark,port},netiface}.c as ip_set_hash_gen.h
defines it correctly for such set types anyway.

Signed-off-by: Sergey Popovich <popovich_sergei@mail.ua>
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
hifive-unleashed-5.1
Sergey Popovich 2015-05-02 19:28:18 +02:00 committed by Pablo Neira Ayuso
parent 275e2bc0f2
commit 58cc06daea
5 changed files with 2 additions and 8 deletions

View File

@ -1166,3 +1166,5 @@ IPSET_TOKEN(HTYPE, _create)(struct net *net, struct ip_set *set,
return 0;
}
#endif /* IP_SET_EMIT_CREATE */
#undef HKEY_DATALEN

View File

@ -211,7 +211,6 @@ hash_ip6_data_next(struct hash_ip4_elem *next, const struct hash_ip6_elem *e)
#undef MTYPE
#undef HOST_MASK
#undef HKEY_DATALEN
#define MTYPE hash_ip6
#define HOST_MASK 128

View File

@ -78,7 +78,6 @@ hash_ipmark4_data_next(struct hash_ipmark4_elem *next,
#define MTYPE hash_ipmark4
#define HOST_MASK 32
#define HKEY_DATALEN sizeof(struct hash_ipmark4_elem)
#include "ip_set_hash_gen.h"
static int
@ -207,11 +206,9 @@ hash_ipmark6_data_next(struct hash_ipmark4_elem *next,
#undef MTYPE
#undef HOST_MASK
#undef HKEY_DATALEN
#define MTYPE hash_ipmark6
#define HOST_MASK 128
#define HKEY_DATALEN sizeof(struct hash_ipmark6_elem)
#define IP_SET_EMIT_CREATE
#include "ip_set_hash_gen.h"

View File

@ -85,7 +85,6 @@ hash_ipport4_data_next(struct hash_ipport4_elem *next,
#define MTYPE hash_ipport4
#define HOST_MASK 32
#define HKEY_DATALEN sizeof(struct hash_ipport4_elem)
#include "ip_set_hash_gen.h"
static int
@ -245,11 +244,9 @@ hash_ipport6_data_next(struct hash_ipport4_elem *next,
#undef MTYPE
#undef HOST_MASK
#undef HKEY_DATALEN
#define MTYPE hash_ipport6
#define HOST_MASK 128
#define HKEY_DATALEN sizeof(struct hash_ipport6_elem)
#define IP_SET_EMIT_CREATE
#include "ip_set_hash_gen.h"

View File

@ -460,7 +460,6 @@ hash_netiface6_data_next(struct hash_netiface4_elem *next,
#undef MTYPE
#undef HOST_MASK
#undef HKEY_DATALEN
#define MTYPE hash_netiface6
#define HOST_MASK 128