Skip to content

Commit

Permalink
Reload MPTCP when IP change or after connection status change
Browse files Browse the repository at this point in the history
  • Loading branch information
Ysurac committed Oct 18, 2024
1 parent 7d7b721 commit cd9f6bc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion omr-tracker/files/usr/share/omr/post-tracking.d/003-up
Original file line number Diff line number Diff line change
Expand 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"
Expand Down

0 comments on commit cd9f6bc

Please sign in to comment.