mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
udp6: set rx_dst_cookie on rx_dst updates
Currently, in the udp6 code, the dst cookie is not initialized/updated
concurrently with the RX dst used by early demux.
As a result, the dst_check() in the early_demux path always fails,
the rx dst cache is always invalidated, and we can't really
leverage significant gain from the demux lookup.
Fix it adding udp6 specific variant of sk_rx_dst_set() and use it
to set the dst cookie when the dst entry is really changed.
The issue is there since the introduction of early demux for ipv6.
Fixes: 5425077d73 ("net: ipv6: Add early demux handler for UDP unicast")
Acked-by: Hannes Frederic Sowa <[email protected]>
Signed-off-by: Paolo Abeni <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
2207d182c1
commit
64f0f5d18a
3 changed files with 14 additions and 3 deletions
|
|
@ -1929,14 +1929,16 @@ drop:
|
|||
/* For TCP sockets, sk_rx_dst is protected by socket lock
|
||||
* For UDP, we use xchg() to guard against concurrent changes.
|
||||
*/
|
||||
void udp_sk_rx_dst_set(struct sock *sk, struct dst_entry *dst)
|
||||
bool udp_sk_rx_dst_set(struct sock *sk, struct dst_entry *dst)
|
||||
{
|
||||
struct dst_entry *old;
|
||||
|
||||
if (dst_hold_safe(dst)) {
|
||||
old = xchg(&sk->sk_rx_dst, dst);
|
||||
dst_release(old);
|
||||
return old != dst;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
EXPORT_SYMBOL(udp_sk_rx_dst_set);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue