Use iptables pipes in BandwidthController startup.
Most of BandwidthController startup is already using
iptables-restore, but some commands (notably listing the costly
chains so they can be flushed by flushCleanTables) still
use iptables. Move these to use execIptablesRestoreWithOutput.
Test: netd_unit_test passes
Bug: 34873832
Change-Id: Ib0741a99a2605cd6934186fd4e5364331a4eab5a
diff --git a/server/BandwidthController.h b/server/BandwidthController.h
index 53385d1..66fdeee 100644
--- a/server/BandwidthController.h
+++ b/server/BandwidthController.h
@@ -195,7 +195,7 @@
* Deals with both ip4 and ip6 tables.
*/
void flushExistingCostlyTables(bool doClean);
- static void parseAndFlushCostlyTables(FILE *fp, bool doRemove);
+ static void parseAndFlushCostlyTables(const std::string& ruleList, bool doRemove);
/*
* Attempt to flush our tables.
@@ -226,7 +226,7 @@
friend class BandwidthControllerTest;
static int (*execFunction)(int, char **, int *, bool, bool);
static FILE *(*popenFunction)(const char *, const char *);
- static int (*iptablesRestoreFunction)(IptablesTarget, const std::string&);
+ static int (*iptablesRestoreFunction)(IptablesTarget, const std::string&, std::string *);
};
#endif