Speed up FirewallController startup.
FirewallController::createChain runs iptables commands to remove
the newly-created chain from fw_INPUT. This is not necessary,
because createChain is only called from setupIptablesHooks, which
is only called immediately after initIptablesRules, which clears
fw_INPUT. So there is nothing to delete.
Removing these unnecessary commands speeds up netd startup by
~150ms. Before:
02-03 18:51:40.075 492 492 I Netd : Setting up FirewallController hooks: 159.9ms
After:
02-03 18:45:22.005 489 489 I Netd : Setting up FirewallController hooks: 11.3ms
Bug: 34873832
Test: unit tests continue to pass
Change-Id: I651d96a71c98d6aba989927cd23036d5cc371dd7
diff --git a/server/FirewallController.h b/server/FirewallController.h
index d78b461..67d632c 100644
--- a/server/FirewallController.h
+++ b/server/FirewallController.h
@@ -93,7 +93,7 @@
FirewallType mFirewallType;
int attachChain(const char*, const char*);
int detachChain(const char*, const char*);
- int createChain(const char*, const char*, FirewallType);
+ int createChain(const char*, FirewallType);
FirewallType getFirewallType(ChildChain);
};