From cd9f6bc29ecd2d20484388136b7e883d7f1e2e58 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 18 Oct 2024 17:32:15 +0200 Subject: [PATCH] Reload MPTCP when IP change or after connection status change --- omr-tracker/files/usr/share/omr/post-tracking.d/003-up | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/omr-tracker/files/usr/share/omr/post-tracking.d/003-up b/omr-tracker/files/usr/share/omr/post-tracking.d/003-up index 379ce9173a..a5f8c8b3c8 100755 --- a/omr-tracker/files/usr/share/omr/post-tracking.d/003-up +++ b/omr-tracker/files/usr/share/omr/post-tracking.d/003-up @@ -1053,11 +1053,15 @@ fi if [ "$(sysctl -qen net.mptcp.mptcp_enabled | tr -d '\n')" = "1" ] || [ "$(sysctl -qen net.mptcp.enabled | tr -d '\n')" = "1" ]; then [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipathvpn)" != "1" ] && [ "$(uci -q get network.globals.mptcp_force_multipath)" != "0" ] && [ "$(uci -q get network.globals.multipath)" = "enable" ] && { if [ "$multipath_status" = "$multipath_config" ] && ([ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.local_ipv4)" != "$OMR_TRACKER_DEVICE_IP" ] || [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.local_ipv6)" != "$OMR_TRACKER_DEVICE_IP6" ]); then + if [ "$(uci -q get network.$OMR_TRACKER_INTERFACE.force_link)" != "0" ]; then + _log "Reload MPTCP config for $OMR_TRACKER_DEVICE" + /etc/init.d/mptcp reload "$OMR_TRACKER_DEVICE" + fi _log "Local IP changed for $OMR_TRACKER_DEVICE ($OMR_TRACKER_INTERFACE) force Multipath" multipath "$OMR_TRACKER_DEVICE" "$multipath_config" uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.local_ipv4="$OMR_TRACKER_DEVICE_IP" uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.local_ipv6="$OMR_TRACKER_DEVICE_IP6" - elif [ "$multipath_status" != "$multipath_config" ]; then + elif [ "$multipath_status" != "$multipath_config" ] || ([ "$OMR_TRACKER_PREV_STATUS" != "" ] && [ "$OMR_TRACKER_PREV_STATUS" != "$OMR_TRACKER_STATUS" ]); then if [ "$(uci -q get network.$OMR_TRACKER_INTERFACE.force_link)" != "0" ]; then _log "Reload MPTCP config for $OMR_TRACKER_DEVICE" /etc/init.d/mptcp reload "$OMR_TRACKER_DEVICE"