netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ipv6: Fix PMTU updates for UDP/raw sockets in presence of VRF
@ 2018-11-18 18:45 David Ahern
  2018-11-19  3:03 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: David Ahern @ 2018-11-18 18:45 UTC (permalink / raw)
  To: netdev; +Cc: preethir, David Ahern

From: David Ahern <dsahern@gmail.com>

Preethi reported that PMTU discovery for UDP/raw applications is not
working in the presence of VRF when the socket is not bound to a device.
The problem is that ip6_sk_update_pmtu does not consider the L3 domain
of the skb device if the socket is not bound. Update the function to
set oif to the L3 master device if relevant.

Fixes: ca254490c8df ("net: Add VRF support to IPv6 stack")
Reported-by: Preethi Ramachandra <preethir@juniper.net>
Signed-off-by: David Ahern <dsahern@gmail.com>
---
 net/ipv6/route.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 14b422f35504..059f0531f7c1 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2359,10 +2359,13 @@ EXPORT_SYMBOL_GPL(ip6_update_pmtu);
 
 void ip6_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, __be32 mtu)
 {
+	int oif = sk->sk_bound_dev_if;
 	struct dst_entry *dst;
 
-	ip6_update_pmtu(skb, sock_net(sk), mtu,
-			sk->sk_bound_dev_if, sk->sk_mark, sk->sk_uid);
+	if (!oif && skb->dev)
+		oif = l3mdev_master_ifindex(skb->dev);
+
+	ip6_update_pmtu(skb, sock_net(sk), mtu, oif, sk->sk_mark, sk->sk_uid);
 
 	dst = __sk_dst_get(sk);
 	if (!dst || !dst->obsolete ||
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] ipv6: Fix PMTU updates for UDP/raw sockets in presence of VRF
  2018-11-18 18:45 [PATCH net] ipv6: Fix PMTU updates for UDP/raw sockets in presence of VRF David Ahern
@ 2018-11-19  3:03 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-11-19  3:03 UTC (permalink / raw)
  To: dsahern; +Cc: netdev, preethir, dsahern

From: David Ahern <dsahern@kernel.org>
Date: Sun, 18 Nov 2018 10:45:30 -0800

> From: David Ahern <dsahern@gmail.com>
> 
> Preethi reported that PMTU discovery for UDP/raw applications is not
> working in the presence of VRF when the socket is not bound to a device.
> The problem is that ip6_sk_update_pmtu does not consider the L3 domain
> of the skb device if the socket is not bound. Update the function to
> set oif to the L3 master device if relevant.
> 
> Fixes: ca254490c8df ("net: Add VRF support to IPv6 stack")
> Reported-by: Preethi Ramachandra <preethir@juniper.net>
> Signed-off-by: David Ahern <dsahern@gmail.com>

Applied and queued up for -stable.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-19 13:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-18 18:45 [PATCH net] ipv6: Fix PMTU updates for UDP/raw sockets in presence of VRF David Ahern
2018-11-19  3:03 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).