mwan3: check removed route before removal

This makes mwan3rtmon check if mwan3_get_routes returns a route
before removing it. This helps with IPv6 routes with source address
selector removal where multiple original routes are transformed to
the same mwan3 route if one of the source routes is removed while
the others are kept.

Signed-off-by: Jonas Lochmann <git@inkompetenz.org>
This commit is contained in:
Jonas Lochmann 2024-01-01 01:00:00 +01:00 committed by Florian Eckert
parent fe736b2f8c
commit e119a57e97
2 changed files with 8 additions and 1 deletions

View File

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=mwan3
PKG_VERSION:=2.11.12
PKG_VERSION:=2.11.13
PKG_RELEASE:=2
PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>, \
Aaron Goodman <aaronjg@alumni.stanford.edu>

View File

@ -95,6 +95,13 @@ mwan3_rtmon_route_handle()
fi
route_line=$(echo "$route_line" | sed -ne "$MWAN3_ROUTE_LINE_EXP")
if [ "$action" = "del" ]; then
if mwan3_get_routes | grep -qxF "$route_line"; then
LOG debug "deleted but route still exists - $route_line"
return
fi
fi
handle_route() {
local error
local iface=$1