Merge "Reduce advertised ipv6 mtu by 16 to fit ethernet header"

This commit is contained in:
Treehugger Robot
2020-02-19 11:20:29 +00:00
committed by Gerrit Code Review

View File

@@ -610,7 +610,12 @@ public class IpServer extends StateMachine {
if (v6only != null) { if (v6only != null) {
params = new RaParams(); params = new RaParams();
params.mtu = v6only.getMtu(); // We advertise an mtu lower by 16, which is the closest multiple of 8 >= 14,
// the ethernet header size. This makes kernel ebpf tethering offload happy.
// This hack should be reverted once we have the kernel fixed up.
// Note: this will automatically clamp to at least 1280 (ipv6 minimum mtu)
// see RouterAdvertisementDaemon.java putMtu()
params.mtu = v6only.getMtu() - 16;
params.hasDefaultRoute = v6only.hasIpv6DefaultRoute(); params.hasDefaultRoute = v6only.hasIpv6DefaultRoute();
if (params.hasDefaultRoute) params.hopLimit = getHopLimit(v6only.getInterfaceName()); if (params.hasDefaultRoute) params.hopLimit = getHopLimit(v6only.getInterfaceName());