mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
ipv6: Limit mtu to 65575 bytes
Francois reported that setting big mtu on loopback device could prevent tcp sessions making progress. We do not support (yet ?) IPv6 Jumbograms and cook corrupted packets. We must limit the IPv6 MTU to (65535 + 40) bytes in theory. Tested: ifconfig lo mtu 70000 netperf -H ::1 Before patch : Throughput : 0.05 Mbits After patch : Throughput : 35484 Mbits Reported-by: Francois WELLENREITER <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Acked-by: YOSHIFUJI Hideaki <[email protected]> Acked-by: Hannes Frederic Sowa <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
05ab8f2647
commit
30f78d8ebf
2 changed files with 8 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue