Make NATing add/remove iptable rules as needed
It was flushing on every unNAT, but really you want to remove just those rules. We'll
Flush when we get to 0 NATs.
bug: 2542176
Change-Id: Ia70580191b1aed754689864044de122234346011
diff --git a/NatController.h b/NatController.h
index 4182f1d..1ab0202 100644
--- a/NatController.h
+++ b/NatController.h
@@ -31,9 +31,12 @@
int disableNat(const char *intIface, const char *extIface);
private:
+ int natCount;
+
int setDefaults();
int runIptablesCmd(const char *cmd);
bool interfaceExists(const char *iface);
+ int doNatCommands(const char *intIface, const char *extIface, bool add);
};
#endif