From f94975b71fc80912dd84feb845c2d86aeb82e7b1 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Thu, 27 Apr 2017 09:22:27 +0200 Subject: [PATCH] net/mwan3: add connected network regardless of mwan3 interface enable state If netifd set an interface up/down which is not tracked by mwan3 the connected network of that interface should regardless be added/removed to the mwan3_connected ipset. Signed-off-by: Florian Eckert --- net/mwan3/files/etc/hotplug.d/iface/15-mwan3 | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/net/mwan3/files/etc/hotplug.d/iface/15-mwan3 b/net/mwan3/files/etc/hotplug.d/iface/15-mwan3 index 32bfa82a3..a13ff8324 100644 --- a/net/mwan3/files/etc/hotplug.d/iface/15-mwan3 +++ b/net/mwan3/files/etc/hotplug.d/iface/15-mwan3 @@ -4,11 +4,6 @@ . /lib/functions/network.sh . /lib/mwan3/mwan3.sh -config_load mwan3 - -config_get enabled $INTERFACE enabled 0 -[ "$enabled" == "1" ] || exit 0 - [ "$ACTION" == "ifup" -o "$ACTION" == "ifdown" ] || exit 1 [ -n "$INTERFACE" ] || exit 2 @@ -22,6 +17,12 @@ fi [ -x /usr/sbin/ip6tables ] || exit 7 [ -x /usr/bin/logger ] || exit 8 +mwan3_set_connected_iptables + +config_load mwan3 +config_get enabled $INTERFACE enabled 0 +[ "$enabled" == "1" ] || exit 0 + if [ "$ACTION" == "ifup" ]; then config_get family $INTERFACE family ipv4 if [ "$family" = "ipv4" ]; then @@ -45,8 +46,6 @@ fi $LOG notice "$ACTION interface $INTERFACE (${DEVICE:-unknown})" -mwan3_set_connected_iptables - case "$ACTION" in ifup) mwan3_set_general_rules