1
0
mirror of https://github.com/yurisieucuti/treble_evolution.git synced 2024-11-24 10:56:22 +00:00
treble_evolution/patches/trebledroid/platform_system_netd/0002-Don-t-fail-on-FTP-conntracking-failing.patch
2024-03-10 06:48:11 +00:00

46 lines
1.8 KiB
Diff

From d91817817a1012cc644237496c4b252cea9cbaa5 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 29 Jul 2019 18:09:12 +0200
Subject: [PATCH 2/4] Don't fail on FTP conntracking failing
The issue has been seen on some Samsung devices.
See https://github.com/phhusson/treble_experimentations/issues/425
Thanks @zamrih for pin-pointing the issue and validating fix
Change-Id: I3d9c865eb5a4b421f9983210c2ceae62b4906234
---
server/TetherController.cpp | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/server/TetherController.cpp b/server/TetherController.cpp
index d867cea4..00c979d8 100644
--- a/server/TetherController.cpp
+++ b/server/TetherController.cpp
@@ -722,13 +722,19 @@ int TetherController::setForwardRules(bool add, const char *intIface, const char
return -EREMOTEIO;
}
- std::vector<std::string> v4 = {
+ std::vector<std::string> v4Ftp = {
"*raw",
- StringPrintf("%s %s -p tcp --dport 21 -i %s -j CT --helper ftp", op,
- LOCAL_RAW_PREROUTING, intIface),
+ StringPrintf("%s %s -p tcp --dport 21 -i %s -j CT --helper ftp",
+ op, LOCAL_RAW_PREROUTING, intIface),
StringPrintf("%s %s -p tcp --dport 1723 -i %s -j CT --helper pptp", op,
LOCAL_RAW_PREROUTING, intIface),
"COMMIT",
+ };
+ if(iptablesRestoreFunction(V4, Join(v4Ftp, '\n'), nullptr) == -1) {
+ ALOGE("Failed adding iptables CT target on FTP.");
+ }
+
+ std::vector<std::string> v4 = {
"*filter",
StringPrintf("%s %s -i %s -o %s -m state --state ESTABLISHED,RELATED -g %s", op,
LOCAL_FORWARD, extIface, intIface, LOCAL_TETHER_COUNTERS_CHAIN),
--
2.25.1