Skip to content

Commit d699097

Browse files
ebirgerklassert
authored andcommitted
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: ccd740c ("vti6: Add pmtu handling to vti6_xmit.") Signed-off-by: Eyal Birger <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
1 parent 1c8c5a9 commit d699097

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

net/ipv6/ip6_vti.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -480,10 +480,6 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)
480480
goto tx_err_dst_release;
481481
}
482482

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-
487483
mtu = dst_mtu(dst);
488484
if (!skb->ignore_df && skb->len > mtu) {
489485
skb_dst_update_pmtu(skb, mtu);
@@ -498,9 +494,14 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)
498494
htonl(mtu));
499495
}
500496

501-
return -EMSGSIZE;
497+
err = -EMSGSIZE;
498+
goto tx_err_dst_release;
502499
}
503500

501+
skb_scrub_packet(skb, !net_eq(t->net, dev_net(dev)));
502+
skb_dst_set(skb, dst);
503+
skb->dev = skb_dst(skb)->dev;
504+
504505
err = dst_output(t->net, skb->sk, skb);
505506
if (net_xmit_eval(err) == 0) {
506507
struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats);

0 commit comments

Comments
 (0)