* [PATCH net] udp: restore UDPlite many-cast delivery
@ 2016-11-14 22:40 Pablo Neira Ayuso
2016-11-15 0:43 ` Eric Dumazet
2016-11-16 3:14 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2016-11-14 22:40 UTC (permalink / raw)
To: netdev; +Cc: davem, edumazet, drheld
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>
---
It looks like UDPlite accidentally broke when dealing with long UDP many-cast
chains, give the wrong table is used for udplite. Compile tested only.
net/ipv4/udp.c | 6 +++---
net/ipv6/udp.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 195992e0440d..5b5a552a2804 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1731,10 +1731,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);
}
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index a7700bbf6788..a9dd23d5c3c4 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -688,10 +688,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);
}
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net] udp: restore UDPlite many-cast delivery
2016-11-14 22:40 [PATCH net] udp: restore UDPlite many-cast delivery Pablo Neira Ayuso
@ 2016-11-15 0:43 ` Eric Dumazet
2016-11-16 3:14 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2016-11-15 0:43 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: netdev, davem, edumazet, drheld
On Mon, 2016-11-14 at 23:40 +0100, Pablo Neira Ayuso wrote:
> 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>
> ---
> It looks like UDPlite accidentally broke when dealing with long UDP many-cast
> chains, give the wrong table is used for udplite. Compile tested only.
Good catch. Looks like some people actually use UDPlite ;)
Acked-by: Eric Dumazet <edumazet@google.com>
Thanks Pablo.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net] udp: restore UDPlite many-cast delivery
2016-11-14 22:40 [PATCH net] udp: restore UDPlite many-cast delivery Pablo Neira Ayuso
2016-11-15 0:43 ` Eric Dumazet
@ 2016-11-16 3:14 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-11-16 3:14 UTC (permalink / raw)
To: pablo; +Cc: netdev, edumazet, drheld
From: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Mon, 14 Nov 2016 23:40:30 +0100
> 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>
Applied and queued up for -stable, thanks Pablo.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-11-16 3:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-14 22:40 [PATCH net] udp: restore UDPlite many-cast delivery Pablo Neira Ayuso
2016-11-15 0:43 ` Eric Dumazet
2016-11-16 3:14 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox