1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-12 18:41:51 +00:00

Enable MPTCP after routes creation

This commit is contained in:
Ycarus (Yannick Chabanois) 2024-01-15 16:27:21 +01:00
parent f10191f25b
commit 2455e4ab5a
2 changed files with 17 additions and 14 deletions

View file

@ -1,16 +1,16 @@
#!/bin/sh
[ "$ACTION" = ifup -o "$ACTION" = ifupdate -o "$ACTION" = ifdown -o "$ACTION" = iflink ] || exit 0
[ "$ACTION" = ifupdate -a -z "$IFUPDATE_ADDRESSES" -a -z "$IFUPDATE_DATA" ] && exit 0
#[ "$ACTION" = ifupdate -a -z "$IFUPDATE_ADDRESSES" -a -z "$IFUPDATE_DATA" ] && exit 0
/etc/init.d/mptcp enabled || exit 0
if [ "$ACTION" = ifup -o "$ACTION" = ifupdate -o "$ACTION" = iflink ] && [ -z "$(echo $DEVICE | grep oip | grep gre)" ]; then
logger -t "mptcp" "Reloading mptcp config due to $ACTION of $INTERFACE ($DEVICE)"
/etc/init.d/mptcp reload "$DEVICE" >/dev/null || exit 0
else
logger -t "mptcp" "Set multipath off on $DEVICE ($INTERFACE) due to $ACTION"
#if [ "$ACTION" = ifup -o "$ACTION" = ifupdate -o "$ACTION" = iflink ] && [ -z "$(echo $DEVICE | grep oip | grep gre)" ]; then
# logger -t "mptcp" "Reloading mptcp config due to $ACTION of $INTERFACE ($DEVICE)"
# /etc/init.d/mptcp reload "$DEVICE" >/dev/null || exit 0
#else
if [ "$ACTION" = ifdown ]; then
multipath $DEVICE off 2>&1 >/dev/null
fi

View file

@ -205,14 +205,6 @@ interface_multipath_settings() {
#echo "îface: $iface"
if [ "$(uci -q get openmptcprouter.settings.force_multipath)" != "0" ]; then
logger -t "MPTCP" "Set $iface to $mode"
if [ "$mode" = "master" ]; then
multipath "$iface" "on"
else
multipath "$iface" "$mode"
fi
fi
#[ "$mode" = "off" ] && {
# ip rule del table $id > /dev/null 2>&1
# ip route flush $id > /dev/null 2>&1
@ -409,6 +401,16 @@ interface_multipath_settings() {
#}
fi
fi
if [ "$(uci -q get openmptcprouter.settings.force_multipath)" != "0" ]; then
logger -t "MPTCP" "Set $iface to $mode"
if [ "$mode" = "master" ]; then
multipath "$iface" "on"
else
multipath "$iface" "$mode"
fi
fi
}
load_interfaces() {
@ -502,6 +504,7 @@ start_service() {
local id count intfmaster
. /lib/functions.sh
. /lib/functions/network.sh
[ -n "$intf" ] && multipath "${intf}" off 2>&1 >/dev/null
global_multipath_settings
[ -n "$(ubus call system board | jsonfilter -e '@.board_name' | grep '3-model-b')" ] && [ "$(ip link show eth0 | grep UP)" = "" ] && {