]> git.karo-electronics.de Git - linux-beck.git/commitdiff
udp: restore UDPlite many-cast delivery
authorPablo Neira <pablo@netfilter.org>
Mon, 14 Nov 2016 22:40:30 +0000 (23:40 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Nov 2016 03:14:27 +0000 (22:14 -0500)
Honor udptable parameter that is passed to __udp*_lib_mcast_deliver(),
otherwise udplite broadcast/multicast use the wrong table and it breaks.

Fixes: 2dc41cff7545 ("udp: Use hash2 for long hash1 chains in __udp*_lib_mcast_deliver.")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/udp.c
net/ipv6/udp.c

index d123d68f4d1de093a9e9b36f210600fa7406d5e9..0de9d5d2b9ae5cde981924ff0341d20b3e79c3d9 100644 (file)
@@ -1652,10 +1652,10 @@ static int __udp4_lib_mcast_deliver(struct net *net, struct sk_buff *skb,
 
        if (use_hash2) {
                hash2_any = udp4_portaddr_hash(net, htonl(INADDR_ANY), hnum) &
-                           udp_table.mask;
-               hash2 = udp4_portaddr_hash(net, daddr, hnum) & udp_table.mask;
+                           udptable->mask;
+               hash2 = udp4_portaddr_hash(net, daddr, hnum) & udptable->mask;
 start_lookup:
-               hslot = &udp_table.hash2[hash2];
+               hslot = &udptable->hash2[hash2];
                offset = offsetof(typeof(*sk), __sk_common.skc_portaddr_node);
        }
 
index b2ef061e6836af29048d1d86ed7b29587f3dd410..e5056d4873d1b62ca33f006f71ed65d06461c48f 100644 (file)
@@ -706,10 +706,10 @@ static int __udp6_lib_mcast_deliver(struct net *net, struct sk_buff *skb,
 
        if (use_hash2) {
                hash2_any = udp6_portaddr_hash(net, &in6addr_any, hnum) &
-                           udp_table.mask;
-               hash2 = udp6_portaddr_hash(net, daddr, hnum) & udp_table.mask;
+                           udptable->mask;
+               hash2 = udp6_portaddr_hash(net, daddr, hnum) & udptable->mask;
 start_lookup:
-               hslot = &udp_table.hash2[hash2];
+               hslot = &udptable->hash2[hash2];
                offset = offsetof(typeof(*sk), __sk_common.skc_portaddr_node);
        }