]> git.karo-electronics.de Git - linux-beck.git/blobdiff - net/ipv6/route.c
ipv6: Limit mtu to 65575 bytes
[linux-beck.git] / net / ipv6 / route.c
index 5015c50a5ba7db02b9a8cc842bd0e28b7f3e8782..5ea462eacd9ff7cb6cc04380ca4c605581580ca5 100644 (file)
@@ -1338,7 +1338,7 @@ static unsigned int ip6_mtu(const struct dst_entry *dst)
        unsigned int mtu = dst_metric_raw(dst, RTAX_MTU);
 
        if (mtu)
-               return mtu;
+               goto out;
 
        mtu = IPV6_MIN_MTU;
 
@@ -1348,7 +1348,8 @@ static unsigned int ip6_mtu(const struct dst_entry *dst)
                mtu = idev->cnf.mtu6;
        rcu_read_unlock();
 
-       return mtu;
+out:
+       return min_t(unsigned int, mtu, IP6_MAX_MTU);
 }
 
 static struct dst_entry *icmp6_dst_gc_list;