]> granicus.if.org Git - ipset/commitdiff
netfilter: ipset: Fix hashing for ipv6 sets
authorSergey Popovich <popovich_sergei@mail.ua>
Fri, 23 Jan 2015 12:58:45 +0000 (14:58 +0200)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Tue, 24 Mar 2015 20:19:10 +0000 (21:19 +0100)
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>
kernel/net/netfilter/ipset/ip_set_hash_gen.h
kernel/net/netfilter/ipset/ip_set_hash_ip.c
kernel/net/netfilter/ipset/ip_set_hash_ipmark.c
kernel/net/netfilter/ipset/ip_set_hash_ipport.c
kernel/net/netfilter/ipset/ip_set_hash_netiface.c

index d9b4a2a3a7d37d66fb3aede1b82b67bd85af623d..102aa169782e227bd7dc67d53503f8eb5fa7be93 100644 (file)
@@ -1331,3 +1331,5 @@ IPSET_TOKEN(HTYPE, _create)(struct net *net, struct ip_set *set,
        return 0;
 }
 #endif /* IP_SET_EMIT_CREATE */
+
+#undef HKEY_DATALEN
index 48e2ee452b057acdc08869ed588726c3b5886ef4..967b6e624c6a5c6ea872ca1324903bfedb573eec 100644 (file)
@@ -205,7 +205,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 4f6fc0da7bce45e566cb906322f0bcdec723ed00..32fbb59f3e0c3a7b7cfe109e1c1d234c76c5a5a1 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
@@ -201,11 +200,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 19afae9dfd99682f2571c8f72fad906a7b4bf23f..4311d2b7abd1260bb1b43bd9fb764324ddefb63e 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
@@ -240,11 +239,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 c9551f34bb5391c390a4ced7ed3fd8f0a074f659..646c9f5cd313047bd5d24cd764b81cb5711c0c9c 100644 (file)
@@ -341,7 +341,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