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

Commit e3dc847a authored by Steffen Klassert's avatar Steffen Klassert
Browse files

vti6: Don't report path MTU below IPV6_MIN_MTU.



In vti6_xmit(), the check for IPV6_MIN_MTU before we
send a ICMPV6_PKT_TOOBIG message is missing. So we might
report a PMTU below 1280. Fix this by adding the required
check.

Fixes: ccd740cb ("vti6: Add pmtu handling to vti6_xmit.")
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
parent 4c86d777
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -484,11 +484,15 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)
	if (!skb->ignore_df && skb->len > mtu) {
		skb_dst(skb)->ops->update_pmtu(dst, NULL, skb, mtu);

		if (skb->protocol == htons(ETH_P_IPV6))
		if (skb->protocol == htons(ETH_P_IPV6)) {
			if (mtu < IPV6_MIN_MTU)
				mtu = IPV6_MIN_MTU;

			icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
		else
		} else {
			icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
				  htonl(mtu));
		}

		return -EMSGSIZE;
	}