mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Enable MPTCP after routes creation
This commit is contained in:
parent
f10191f25b
commit
2455e4ab5a
2 changed files with 17 additions and 14 deletions
|
@ -1,16 +1,16 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
[ "$ACTION" = ifup -o "$ACTION" = ifupdate -o "$ACTION" = ifdown -o "$ACTION" = iflink ] || exit 0
|
[ "$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
|
/etc/init.d/mptcp enabled || exit 0
|
||||||
|
|
||||||
|
|
||||||
if [ "$ACTION" = ifup -o "$ACTION" = ifupdate -o "$ACTION" = iflink ] && [ -z "$(echo $DEVICE | grep oip | grep gre)" ]; then
|
#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)"
|
# logger -t "mptcp" "Reloading mptcp config due to $ACTION of $INTERFACE ($DEVICE)"
|
||||||
/etc/init.d/mptcp reload "$DEVICE" >/dev/null || exit 0
|
# /etc/init.d/mptcp reload "$DEVICE" >/dev/null || exit 0
|
||||||
else
|
#else
|
||||||
logger -t "mptcp" "Set multipath off on $DEVICE ($INTERFACE) due to $ACTION"
|
if [ "$ACTION" = ifdown ]; then
|
||||||
multipath $DEVICE off 2>&1 >/dev/null
|
multipath $DEVICE off 2>&1 >/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -205,14 +205,6 @@ interface_multipath_settings() {
|
||||||
|
|
||||||
#echo "îface: $iface"
|
#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" ] && {
|
#[ "$mode" = "off" ] && {
|
||||||
# ip rule del table $id > /dev/null 2>&1
|
# ip rule del table $id > /dev/null 2>&1
|
||||||
# ip route flush $id > /dev/null 2>&1
|
# ip route flush $id > /dev/null 2>&1
|
||||||
|
@ -409,6 +401,16 @@ interface_multipath_settings() {
|
||||||
#}
|
#}
|
||||||
fi
|
fi
|
||||||
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() {
|
load_interfaces() {
|
||||||
|
@ -502,6 +504,7 @@ start_service() {
|
||||||
local id count intfmaster
|
local id count intfmaster
|
||||||
. /lib/functions.sh
|
. /lib/functions.sh
|
||||||
. /lib/functions/network.sh
|
. /lib/functions/network.sh
|
||||||
|
[ -n "$intf" ] && multipath "${intf}" off 2>&1 >/dev/null
|
||||||
global_multipath_settings
|
global_multipath_settings
|
||||||
|
|
||||||
[ -n "$(ubus call system board | jsonfilter -e '@.board_name' | grep '3-model-b')" ] && [ "$(ip link show eth0 | grep UP)" = "" ] && {
|
[ -n "$(ubus call system board | jsonfilter -e '@.board_name' | grep '3-model-b')" ] && [ "$(ip link show eth0 | grep UP)" = "" ] && {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue