X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=iprule.c;h=4e3dd155cc9b4a92a021d6cfcad3a6c11cb24fd9;hp=27acef4a553371cfccc7e7fffbc371b08e9bbfd1;hb=fb2f843edf44c6f12b636cd82cdd1c71e953495f;hpb=97e748de49c02f36a1e75bd9f9552311fb4051b4 diff --git a/iprule.c b/iprule.c index 27acef4..4e3dd15 100644 --- a/iprule.c +++ b/iprule.c @@ -15,7 +15,6 @@ #include #include #include -#include #include @@ -28,6 +27,7 @@ #include "system.h" struct vlist_tree iprules; +static bool iprules_flushed = false; static unsigned int iprules_counter[2]; enum { @@ -59,7 +59,7 @@ static const struct blobmsg_policy rule_attr[__RULE_MAX] = { [RULE_GOTO] = { .name = "goto", .type = BLOBMSG_TYPE_INT32 }, }; -const struct config_param_list rule_attr_list = { +const struct uci_blob_param_list rule_attr_list = { .n_params = __RULE_MAX, .params = rule_attr, }; @@ -208,6 +208,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);