Remove qtaguid support from bandwidth controller
The "--socket-exists" rules in BandwidthController are actually the
rules that enable xt_qtaguid accounting feature. For devices that use
ebpf for packet accounting, these rules need to be removed so that
devices that don't have that kernel module can still run properly.
This change also completely disable xt_qtaguid accounting on devices
that have both xt_qtaguid and eBPF.
Bug: 70945407
Test: device boots and iptables rules are loaded successfully.
Netd_unit_test passes.
Change-Id: I9c11259e38889b5bf4876cff91c97741d624a18d
diff --git a/server/Controllers.cpp b/server/Controllers.cpp
index 0180a07..23f3e9c 100644
--- a/server/Controllers.cpp
+++ b/server/Controllers.cpp
@@ -281,6 +281,7 @@
}
gLog.info("Initializing traffic control: %.1fms", s.getTimeAndReset());
+ bandwidthCtrl.setBpfEnabled(trafficCtrl.checkBpfStatsEnable());
bandwidthCtrl.enableBandwidthControl(false);
gLog.info("Disabling bandwidth control: %.1fms", s.getTimeAndReset());