Skip to content

Commit

Permalink
ipv6: Fix PMTU updates for UDP/raw sockets in presence of VRF
Browse files Browse the repository at this point in the history
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: ca25449 ("net: Add VRF support to IPv6 stack")
Reported-by: Preethi Ramachandra <[email protected]>
Signed-off-by: David Ahern <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
dsahern authored and davem330 committed Nov 19, 2018
1 parent 1c1274a commit 7ddacfa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down

0 comments on commit 7ddacfa

Please sign in to comment.