Stop reducing RA advertised ipv6 mtu by 16 - not needed.

This effectively reverts:

  commit da0fb1bca8
  Author: Maciej Żenczykowski <maze@google.com>
  Date:   Wed Feb 19 01:24:39 2020 -0800

      Reduce advertised ipv6 mtu by 16 to fit ethernet header

      This is a temporary hack to workaround the inability of current
      kernel's ebpf bpf_skb_change_mode() function to prefix a 14-byte
      ethernet header on to a packet without going over the upstream
      (source, rawip) interface's mtu *before* we bpf_redirect() to
      the downstream (destination, ethernet) interface.

      Test: build, atest, atest TetheringTests
      Bug: 149816401

Test: flashed a flame with new kernel and it works at 1500 mtu
Bug: 149816401
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I76a75a16fa27b47d78816b2f9379ef4bb68beb00
Merged-In: I76a75a16fa27b47d78816b2f9379ef4bb68beb00
This commit is contained in:
Maciej Żenczykowski
2020-05-28 03:21:31 -07:00
parent aac3b2ead0
commit f99d2a103d

View File

@@ -730,12 +730,7 @@ public class IpServer extends StateMachine {
final String upstreamIface = v6only.getInterfaceName(); final String upstreamIface = v6only.getInterfaceName();
params = new RaParams(); params = new RaParams();
// When BPF offload is enabled, we advertise an mtu lower by 16, which is the closest params.mtu = v6only.getMtu();
// 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 = mUsingBpfOffload ? v6only.getMtu() - 16 : v6only.getMtu();
params.hasDefaultRoute = v6only.hasIpv6DefaultRoute(); params.hasDefaultRoute = v6only.hasIpv6DefaultRoute();
if (params.hasDefaultRoute) params.hopLimit = getHopLimit(upstreamIface, ttlAdjustment); if (params.hasDefaultRoute) params.hopLimit = getHopLimit(upstreamIface, ttlAdjustment);