mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2026-01-28 01:47:18 +01:00
Added fix for Device.Firewall.Chain.{i}.Rule.{i}.Order re-ordering issue
This commit is contained in:
parent
8dbbaa8f3c
commit
5b43e378e7
1 changed files with 2 additions and 8 deletions
|
|
@ -180,30 +180,24 @@ static void update_rule_order(const char *start_order, const char *stop_order, b
|
|||
|
||||
dmuci_get_value_by_section_string(s, "order", &order);
|
||||
|
||||
if (DM_STRTOUL(order) >= DM_STRTOUL(start_order)) {
|
||||
if ((DM_STRTOUL(order) >= DM_STRTOUL(start_order)) && (DM_STRTOUL(order) <= DM_STRTOUL(stop_order))) {
|
||||
char buf[8] = {0};
|
||||
|
||||
snprintf(buf, sizeof(buf), "%lu", incr ? (DM_STRTOUL(order) + 1) : (DM_STRTOUL(order) - 1));
|
||||
dmuci_set_value_by_section(s, "order", buf);
|
||||
}
|
||||
|
||||
if (DM_STRTOUL(order) == DM_STRTOUL(stop_order))
|
||||
return;
|
||||
}
|
||||
|
||||
uci_path_foreach_sections(bbfdm, "dmmap_firewall", "rule", s) {
|
||||
|
||||
dmuci_get_value_by_section_string(s, "order", &order);
|
||||
|
||||
if (DM_STRTOUL(order) >= DM_STRTOUL(start_order)) {
|
||||
if ((DM_STRTOUL(order) >= DM_STRTOUL(start_order)) && (DM_STRTOUL(order) <= DM_STRTOUL(stop_order))) {
|
||||
char buf[8] = {0};
|
||||
|
||||
snprintf(buf, sizeof(buf), "%lu", incr ? (DM_STRTOUL(order) + 1) : (DM_STRTOUL(order) - 1));
|
||||
dmuci_set_value_by_section(s, "order", buf);
|
||||
}
|
||||
|
||||
if (DM_STRTOUL(order) == DM_STRTOUL(stop_order))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue