From a6606bed17bbddb7ae10405f6b0358fdda26fd17 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Wed, 14 Sep 2022 14:46:58 +0200 Subject: [PATCH 1/3] mwan3: change log message on already added route Only show message on already set route, if debugging is enabled. Signed-off-by: Florian Eckert --- net/mwan3/files/lib/mwan3/mwan3.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mwan3/files/lib/mwan3/mwan3.sh b/net/mwan3/files/lib/mwan3/mwan3.sh index f48a145cb..1bfb767e8 100644 --- a/net/mwan3/files/lib/mwan3/mwan3.sh +++ b/net/mwan3/files/lib/mwan3/mwan3.sh @@ -483,7 +483,7 @@ mwan3_create_iface_route() # if 'connected' was called after 'ifup' [ -n "$tbl" ] && [ -z "${tbl##*$route_line$'\n'*}" ] && continue $IP route add table $id $route_line || - LOG warn "failed to add $route_line to table $id" + LOG debug "Route '$route_line' already added to table $id" fi done From 997c0842ca8b05de83a1ecd3160ecd18fa3d8aee Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Wed, 8 Sep 2021 11:33:55 +0200 Subject: [PATCH 2/3] mwan3: only send disconnected event if interface was connected before Up to now on every interface down event a mwan3 disconnected event was send. This is wrong because if the interface was never connected, then a disconnected event should not get generated. This commit fixes this bug. Signed-off-by: Florian Eckert --- net/mwan3/files/usr/sbin/mwan3track | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/net/mwan3/files/usr/sbin/mwan3track b/net/mwan3/files/usr/sbin/mwan3track index 2c535d59f..89654f86b 100755 --- a/net/mwan3/files/usr/sbin/mwan3track +++ b/net/mwan3/files/usr/sbin/mwan3track @@ -105,14 +105,22 @@ validate_wrap() { } disconnected() { + local status="$(cat ${MWAN3TRACK_STATUS_DIR}/${INTERFACE}/STATUS)" + STATUS='offline' echo "offline" > $MWAN3TRACK_STATUS_DIR/$INTERFACE/STATUS get_uptime > $MWAN3TRACK_STATUS_DIR/$INTERFACE/OFFLINE echo "0" > $MWAN3TRACK_STATUS_DIR/$INTERFACE/ONLINE score=0 [ "$1" = 1 ] && return - LOG notice "Interface $INTERFACE ($DEVICE) is offline" - env -i ACTION="disconnected" INTERFACE="$INTERFACE" DEVICE="$DEVICE" /sbin/hotplug-call iface + + # Only execute disconnectd action if status was online or disconnecting + if [ "$status" = "online" ] || [ "$status" = "disconnecting" ]; then + LOG notice "Interface $INTERFACE ($DEVICE) is offline" + env -i ACTION="disconnected" INTERFACE="$INTERFACE" DEVICE="$DEVICE" /sbin/hotplug-call iface + else + LOG notice "Skip disconnected event for $INTERFACE ($DEVICE)" + fi } connected() { @@ -391,8 +399,8 @@ main() { if [ "${IFDOWN_EVENT}" -eq 1 ]; then LOG debug "Register ifdown event on interface ${INTERFACE} (${DEVICE})" - disabled disconnected + disabled IFDOWN_EVENT=0 fi if [ "${IFUP_EVENT}" -eq 1 ]; then From 8fea564fc9b612fe27b60bbd5839214184be7456 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Mon, 17 Oct 2022 15:16:40 +0200 Subject: [PATCH 3/3] mwan3: update to 2.11.3 Signed-off-by: Florian Eckert --- net/mwan3/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mwan3/Makefile b/net/mwan3/Makefile index 4e5c6e48d..878c4b993 100644 --- a/net/mwan3/Makefile +++ b/net/mwan3/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mwan3 -PKG_VERSION:=2.11.2 +PKG_VERSION:=2.11.3 PKG_RELEASE:=3 PKG_MAINTAINER:=Florian Eckert , \ Aaron Goodman