summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@nvidia.com>2026-09-07 13:13:58 +0300
committerPaolo Abeni <pabeni@redhat.com>2026-09-08 14:48:00 +0200
commit4596be8a15db2e7f45cbb140f6644e2dd2b290db (patch)
treee8c31a3e6c8cecf9ca40cbe107f334641b15fc9b
parent1773727507edcf48f1a402dc35b77ae46a181df7 (diff)
downloadlinux-next-4596be8a15db2e7f45cbb140f6644e2dd2b290db.tar.gz
linux-next-4596be8a15db2e7f45cbb140f6644e2dd2b290db.zip
ipv6: udp: Use ip6_sk_redirect() for tunnel sockets
After commit cd51b74bdd0b ("ipv6: Fix redirect exception creation for UDP/RAW sockets") the two redirect calls are now equivalent and there is no need to specifically call ip6_redirect() for tunnel sockets. Simplify and call ip6_sk_redirect() for both tunnel sockets and regular sockets. Note that for ICMPv6 Redirect Message packets the VRF driver does not reset skb->dev to the VRF device, so skb->dev->ifindex is equivalent to inet6_iif(skb), even when the packet was received from a VRF port. Suggested-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20260907101358.596953-1-idosch@nvidia.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
-rw-r--r--net/ipv6/udp.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 93478d1ad576..59f9872c3552 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -751,13 +751,7 @@ static int udpv6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
harderr = 1;
}
if (type == NDISC_REDIRECT) {
- if (tunnel) {
- ip6_redirect(skb, sock_net(sk), inet6_iif(skb),
- READ_ONCE(sk->sk_mark),
- sk_uid(sk));
- } else {
- ip6_sk_redirect(skb, sk);
- }
+ ip6_sk_redirect(skb, sk);
goto out;
}