mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
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 <fe@dev.tdt.de>
(cherry picked from commit f94975b71f)
This commit is contained in:
@@ -4,11 +4,6 @@
|
|||||||
. /lib/functions/network.sh
|
. /lib/functions/network.sh
|
||||||
. /lib/mwan3/mwan3.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
|
[ "$ACTION" == "ifup" -o "$ACTION" == "ifdown" ] || exit 1
|
||||||
[ -n "$INTERFACE" ] || exit 2
|
[ -n "$INTERFACE" ] || exit 2
|
||||||
|
|
||||||
@@ -22,6 +17,12 @@ fi
|
|||||||
[ -x /usr/sbin/ip6tables ] || exit 7
|
[ -x /usr/sbin/ip6tables ] || exit 7
|
||||||
[ -x /usr/bin/logger ] || exit 8
|
[ -x /usr/bin/logger ] || exit 8
|
||||||
|
|
||||||
|
mwan3_set_connected_iptables
|
||||||
|
|
||||||
|
config_load mwan3
|
||||||
|
config_get enabled $INTERFACE enabled 0
|
||||||
|
[ "$enabled" == "1" ] || exit 0
|
||||||
|
|
||||||
config_get family $INTERFACE family ipv4
|
config_get family $INTERFACE family ipv4
|
||||||
|
|
||||||
if [ "$family" == "ipv4" ]; then
|
if [ "$family" == "ipv4" ]; then
|
||||||
@@ -36,8 +37,6 @@ fi
|
|||||||
|
|
||||||
$LOG notice "$ACTION interface $INTERFACE (${DEVICE:-unknown})"
|
$LOG notice "$ACTION interface $INTERFACE (${DEVICE:-unknown})"
|
||||||
|
|
||||||
mwan3_set_connected_iptables
|
|
||||||
|
|
||||||
case "$ACTION" in
|
case "$ACTION" in
|
||||||
ifup)
|
ifup)
|
||||||
mwan3_set_general_rules
|
mwan3_set_general_rules
|
||||||
|
|||||||
Reference in New Issue
Block a user