TetherController - print less errors on bpf unsupporting devices
Test: build, atest
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0b0bfeadb4a8596ea575c103937af83d5ff26027
diff --git a/server/TetherController.cpp b/server/TetherController.cpp
index 9dd4f2e..a1e2ea4 100644
--- a/server/TetherController.cpp
+++ b/server/TetherController.cpp
@@ -992,6 +992,8 @@
}
void TetherController::maybeStartBpf(const char* extIface) {
+ if (!bpf::isBpfSupported()) return;
+
// TODO: perhaps ignore IPv4-only interface because IPv4 traffic downstream is not supported.
int ifIndex = if_nametoindex(extIface);
if (!ifIndex) {
@@ -1022,6 +1024,8 @@
}
void TetherController::maybeStopBpf(const char* extIface) {
+ if (!bpf::isBpfSupported()) return;
+
// TODO: perhaps ignore IPv4-only interface because IPv4 traffic downstream is not supported.
int ifIndex = if_nametoindex(extIface);
if (!ifIndex) {