Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ccd740cb authored by Steffen Klassert's avatar Steffen Klassert Committed by David S. Miller
Browse files

vti6: Add pmtu handling to vti6_xmit.



We currently rely on the PMTU discovery of xfrm.
However if a packet is localy sent, the PMTU mechanism
of xfrm tries to to local socket notification what
might not work for applications like ping that don't
check for this. So add pmtu handling to vti6_xmit to
report MTU changes immediately.

Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 18ec898e
Loading
Loading
Loading
Loading
+14 −0
Original line number Original line Diff line number Diff line
@@ -435,6 +435,7 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)
	struct net_device *tdev;
	struct net_device *tdev;
	struct xfrm_state *x;
	struct xfrm_state *x;
	int err = -1;
	int err = -1;
	int mtu;


	if (!dst)
	if (!dst)
		goto tx_err_link_failure;
		goto tx_err_link_failure;
@@ -468,6 +469,19 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)
	skb_dst_set(skb, dst);
	skb_dst_set(skb, dst);
	skb->dev = skb_dst(skb)->dev;
	skb->dev = skb_dst(skb)->dev;


	mtu = dst_mtu(dst);
	if (!skb->ignore_df && skb->len > mtu) {
		skb_dst(skb)->ops->update_pmtu(dst, NULL, skb, mtu);

		if (skb->protocol == htons(ETH_P_IPV6))
			icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
		else
			icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
				  htonl(mtu));

		return -EMSGSIZE;
	}

	err = dst_output(skb);
	err = dst_output(skb);
	if (net_xmit_eval(err) == 0) {
	if (net_xmit_eval(err) == 0) {
		struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats);
		struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats);