summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorSteffen Klassert <steffen.klassert@secunet.com>2017-02-15 11:38:58 +0100
committerSteffen Klassert <steffen.klassert@secunet.com>2017-02-16 07:51:42 +0100
commite3dc847a5f85b43ee2bfc8eae407a7e383483228 (patch)
tree281e8e1a764fefde81418f552b2f3ed361181ba4 /net
parent4c86d77743a54fb2d8a4d18a037a074c892bb3be (diff)
downloadlinux-e3dc847a5f85b43ee2bfc8eae407a7e383483228.tar.gz
linux-e3dc847a5f85b43ee2bfc8eae407a7e383483228.tar.bz2
linux-e3dc847a5f85b43ee2bfc8eae407a7e383483228.zip
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: ccd740cbc6e ("vti6: Add pmtu handling to vti6_xmit.") Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/ip6_vti.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c
index d82042c8d8fd..9156d6b9eb24 100644
--- a/net/ipv6/ip6_vti.c
+++ b/net/ipv6/ip6_vti.c
@@ -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;
}