diff options
author | WangYanlong <yanlong.wang@naiver.org> | 2020-03-13 12:29:27 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-03-13 13:40:23 +0100 |
commit | f87d0b0f607420424cfcb4ff5a376d7659fa5b6b (patch) | |
tree | 99bf55e39a3d87e7ebae6fba9f74116c878520cc | |
parent | fe9602cd242d1202875ebdcc41adb7e5930caa63 (diff) | |
download | firewall3-f87d0b0f607420424cfcb4ff5a376d7659fa5b6b.tar.gz |
firewall3: defaults: fix uci flow_offloading option
Fixes 7cc2a84 ("defaults: robustify flow table detection.")
7cc2a84 made disabling flow_offloading impossible.
This is to fix the buggy behavior.
Signed-off-by: Yanlong Wang <yanlong.wang@naiver.org>
[move variable declaration to the top, remove braces from conditional]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r-- | defaults.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -126,6 +126,7 @@ fw3_load_defaults(struct fw3_state *state, struct uci_package *p) struct uci_element *e; struct fw3_defaults *defs = &state->defaults; + bool flow_offload_avaliable = false; bool seen = false; defs->tcp_reject_code = FW3_REJECT_CODE_TCP_RESET; @@ -160,7 +161,10 @@ fw3_load_defaults(struct fw3_state *state, struct uci_package *p) check_any_reject_code(e, &defs->any_reject_code); /* exists in both ipv4 and ipv6, if at all, so only check ipv4 */ - check_target(e, &defs->flow_offloading, "FLOWOFFLOAD", false); + check_target(e, &flow_offload_avaliable, "FLOWOFFLOAD", false); + + if (!flow_offload_avaliable) + defs->flow_offloading = false; } } |