mwan3: change flush_conntrack handling to use uci list element

With this change it is now possible to combine interface action events.
If an interface action is generated by netifd or mwan3 for example ifup,
ifdown, connectd or disconnected and this action is configured in the inteface
uci section, then the conntrack table is flushed by mwan3.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
Florian Eckert
2019-05-22 09:14:38 +02:00
parent 15a0606403
commit 171cb17694
4 changed files with 18 additions and 28 deletions
@@ -79,7 +79,6 @@ case "$ACTION" in
fi
mwan3_set_policies_iptables
mwan3_set_user_rules
mwan3_flush_conntrack $INTERFACE $DEVICE "ifup"
;;
ifdown)
mwan3_set_iface_hotplug_state $INTERFACE "offline"
@@ -87,7 +86,6 @@ case "$ACTION" in
mwan3_track_signal $INTERFACE $DEVICE
mwan3_set_policies_iptables
mwan3_set_user_rules
mwan3_flush_conntrack $INTERFACE $DEVICE "ifdown"
;;
esac
@@ -14,4 +14,9 @@ if [ "$ACTION" == "ifup" ]; then
mwan3_unlock "$ACTION" "mwan3rtmon"
fi
config_get enabled $INTERFACE enabled 0
[ "${enabled}" = "0" ] || {
mwan3_flush_conntrack "$INTERFACE" "$ACTION"
}
exit 0