path: root/kernel/net/netfilter/ipset/ip_set_hash_ip.c
diff options
authorJozsef Kadlecsik <>2011-07-08 11:06:40 +0200
committerJozsef Kadlecsik <>2011-07-08 11:06:40 +0200
commit76f6727dd65d2c3c188b11100257277736e99817 (patch)
tree38d07edf0eb9e948b3089bc3d6d762e795d62125 /kernel/net/netfilter/ipset/ip_set_hash_ip.c
parent21553f360f26843dcd044db689add4adadb60099 (diff)
hash:net,iface fixed to handle overlapping nets behind different interfaces
If overlapping networks with different interfaces was added to the set, the type did not handle it properly. Example ipset create test hash:net,iface ipset add test,eth0 ipset add test,eth1 Now, if a packet was sent from,eth0, the type returned a match. In the patch the algorithm is fixed in order to correctly handle overlapping networks. Limitation: the same network cannot be stored with more than 64 different interfaces in a single set.
Diffstat (limited to 'kernel/net/netfilter/ipset/ip_set_hash_ip.c')
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/net/netfilter/ipset/ip_set_hash_ip.c b/kernel/net/netfilter/ipset/ip_set_hash_ip.c
index fa80bb9..f2d576e 100644
--- a/kernel/net/netfilter/ipset/ip_set_hash_ip.c
+++ b/kernel/net/netfilter/ipset/ip_set_hash_ip.c
@@ -53,7 +53,8 @@ struct hash_ip4_telem {
static inline bool
hash_ip4_data_equal(const struct hash_ip4_elem *ip1,
- const struct hash_ip4_elem *ip2)
+ const struct hash_ip4_elem *ip2,
+ u32 *multi)
return ip1->ip == ip2->ip;
@@ -225,7 +226,8 @@ struct hash_ip6_telem {
static inline bool
hash_ip6_data_equal(const struct hash_ip6_elem *ip1,
- const struct hash_ip6_elem *ip2)
+ const struct hash_ip6_elem *ip2,
+ u32 *multi)
return ipv6_addr_cmp(&ip1->ip.in6, &ip2->ip.in6) == 0;