summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2013-05-27 19:57:58 +0200
committerJo-Philipp Wich <jow@openwrt.org>2013-05-27 19:57:58 +0200
commit0b66ee22a3a339188ab2b8661c6af62883be93c2 (patch)
tree4cc4cf8aef8c95109f7b4eda56f2c1efef918e5d
parent97e748de49c02f36a1e75bd9f9552311fb4051b4 (diff)
Move iprule flushing to the init function to make the timing predictable
-rw-r--r--iprule.c1
-rw-r--r--system-linux.c9
2 files changed, 1 insertions, 9 deletions
diff --git a/iprule.c b/iprule.c
index 27acef4..0ff02de 100644
--- a/iprule.c
+++ b/iprule.c
@@ -247,5 +247,6 @@ iprule_update_rule(struct vlist_tree *tree,
static void __init
iprule_init_list(void)
{
+ system_flush_iprules();
vlist_init(&iprules, rule_cmp, iprule_update_rule);
}
diff --git a/system-linux.c b/system-linux.c
index 76740f7..f5c900d 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -65,8 +65,6 @@ static void handle_hotplug_event(struct uloop_fd *u, unsigned int events);
static char dev_buf[256];
-static bool iprules_flushed = false;
-
static void
handler_nl_event(struct uloop_fd *u, unsigned int events)
{
@@ -1179,13 +1177,6 @@ static int system_iprule(struct iprule *rule, int cmd)
int system_add_iprule(struct iprule *rule)
{
- /* trigger flush of existing rules when adding first rule the first time */
- if (!iprules_flushed)
- {
- system_flush_iprules();
- iprules_flushed = true;
- }
-
return system_iprule(rule, RTM_NEWRULE);
}