Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vti6: fix PMTU caching and reporting on xmit

When setting the skb->dst before doing the MTU check, the route PMTU
caching and reporting is done on the new dst which is about to be
released.

Instead, PMTU handling should be done using the original dst.

This is aligned with IPv4 VTI.

Fixes: ccd740cbc6 ("vti6: Add pmtu handling to vti6_xmit.")
Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>

authored by

Eyal Birger and committed by
Steffen Klassert
d6990976 1c8c5a9d

+6 -5
+6 -5
net/ipv6/ip6_vti.c
··· 480 480 goto tx_err_dst_release; 481 481 } 482 482 483 - skb_scrub_packet(skb, !net_eq(t->net, dev_net(dev))); 484 - skb_dst_set(skb, dst); 485 - skb->dev = skb_dst(skb)->dev; 486 - 487 483 mtu = dst_mtu(dst); 488 484 if (!skb->ignore_df && skb->len > mtu) { 489 485 skb_dst_update_pmtu(skb, mtu); ··· 494 498 htonl(mtu)); 495 499 } 496 500 497 - return -EMSGSIZE; 501 + err = -EMSGSIZE; 502 + goto tx_err_dst_release; 498 503 } 504 + 505 + skb_scrub_packet(skb, !net_eq(t->net, dev_net(dev))); 506 + skb_dst_set(skb, dst); 507 + skb->dev = skb_dst(skb)->dev; 499 508 500 509 err = dst_output(t->net, skb->sk, skb); 501 510 if (net_xmit_eval(err) == 0) {