]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
netfilter: ipset: Fix hashing for ipv6 sets
authorSergey Popovich <popovich_sergei@mail.ua>
Sat, 2 May 2015 17:28:18 +0000 (19:28 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 13 May 2015 16:21:12 +0000 (18:21 +0200)
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>
net/netfilter/ipset/ip_set_hash_gen.h
net/netfilter/ipset/ip_set_hash_ip.c
net/netfilter/ipset/ip_set_hash_ipmark.c
net/netfilter/ipset/ip_set_hash_ipport.c
net/netfilter/ipset/ip_set_hash_netiface.c

index a0430651ecff6e60833bfbb317936506a45e5b83..7b72209e8102d548a9abd0c94a6152717fef5291 100644 (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
index ee7a72b13a5ae65435da848dfa7ac3749a770c66..54df48b5c4558c9e7229abe6d82069af502e2562 100644 (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
index 6ac7073fc85074d86127cc430f096b9fac559dc8..061e7e8a614c2cf58d8ebb736fb20ca79af6984e 100644 (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"
 
index a3117d4ec267b84b6540b6b20aeedd0b6934e13d..e58704eba365feb987500a330e42dc8881b98322 100644 (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"
 
index 07920b60bbf850c861448e45c3c5c7185d64e3a4..fe481f677f56edbbb195ee75008e2ecd01ff0849 100644 (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