diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2013-05-28 12:11:12 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2013-05-28 12:11:12 +0200 |
commit | 7963b8875872e7456687042b69f2b5a4a474e441 (patch) | |
tree | ca9d8b33aae583fd9936441ecf6e2ed974db0ab3 /iprule.c | |
parent | 0b66ee22a3a339188ab2b8661c6af62883be93c2 (diff) |
Make sure that iprule flushing happens after system_init(), otherwise the rtnl_socket is not available
Diffstat (limited to 'iprule.c')
-rw-r--r-- | iprule.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -28,6 +28,7 @@ #include "system.h" struct vlist_tree iprules; +static bool iprules_flushed = false; static unsigned int iprules_counter[2]; enum { @@ -208,6 +209,11 @@ error: void iprule_update_start(void) { + if (!iprules_flushed) { + system_flush_iprules(); + iprules_flushed = true; + } + iprules_counter[0] = 1; iprules_counter[1] = 1; vlist_update(&iprules); @@ -247,6 +253,5 @@ 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); } |