netd: Active FTP Helper
Enable conntrack helper for active FTP connections when
tethering is started.
Bug:69265432
CRs-fixed:2136660
Test: as follows
- Boot device - Pass
- Start tethering - Pass
- Start active FTP on tethered host (USB) - Pass
- Download file over FTP - Pass
- make -j64 netd_unit_test
adb shell /data/nativetest64/netd_unit_test/netd_unit_test - Pass
Change-Id: I5c812afe9602e80ea1c42d0cafba40fe6019a995
diff --git a/server/TetherController.cpp b/server/TetherController.cpp
index d134099..ffc9af5 100644
--- a/server/TetherController.cpp
+++ b/server/TetherController.cpp
@@ -645,6 +645,10 @@
}
std::vector<std::string> v4 = {
+ "*raw",
+ StringPrintf("%s %s -p tcp --dport 21 -i %s -j CT --helper ftp",
+ op, LOCAL_RAW_PREROUTING, intIface),
+ "COMMIT",
"*filter",
StringPrintf("%s %s -i %s -o %s -m state --state ESTABLISHED,RELATED -g %s",
op, LOCAL_FORWARD, extIface, intIface, LOCAL_TETHER_COUNTERS_CHAIN),