patchpanel: allow ARC++ to set mtu on arc0
Change-Id I76c1bca45c2434533800ab4d87cf5d3364a24ed2 changed the
ownership of /sys/class/net/<iface>/mtu inside the ARC++ container so
that system/netd could set the mtu of a network interface in ARC++ for
physical networks.
However, the case of a host VPN connection using arc0 inside Android was
not taken into account. This patch makes Android root the owner of
/sys/class/net/arc0/mtu so that Android traffic can use the correct MTU
on host VPN connections.
Note that ARCVM already has the ability to set the mtu on the virtio
interface used for exposing host VPNs in Android (eth0).
BUG=b:175571457
TEST=deployed patchpanel on rammus, connected host openVPN connection
with explicit MTU parameter, checked that ArcNetworkFactory is able to
set the MTU by callind netd.
Change-Id: I1edb87f1d57a3469f29af4b170f25d6535c999b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2639445
Tested-by: Hugo Benichi <hugobenichi@google.com>
Commit-Queue: Hugo Benichi <hugobenichi@google.com>
Reviewed-by: Damien Dejean <damiendejean@google.com>
Reviewed-by: Hugo Benichi <hugobenichi@google.com>
diff --git a/patchpanel/arc_service.cc b/patchpanel/arc_service.cc
index 8ea2afa..6e829b2 100644
--- a/patchpanel/arc_service.cc
+++ b/patchpanel/arc_service.cc
@@ -383,6 +383,8 @@
<< arc_device_->phys_ifname();
return false;
}
+ // Allow netd to write to /sys/class/net/arc0/mtu (b/175571457).
+ SetContainerSysfsMtuOwner(id, arc_device_->guest_ifname(), "mtu");
}
id_ = id;