1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

合并Ysurac/develop的拉取请求#119

Fix force an interface to be master when not set
This commit is contained in:
suyuan 2021-04-21 01:42:58 +08:00 committed by GitHub
commit 0fa18b7dc9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -116,6 +116,7 @@ interface_multipath_settings() {
[ "$mode" != "off" ] && { [ "$mode" != "off" ] && {
[ -n "$mptcpintf" ] && mptcpintf="$mptcpintf $iface" [ -n "$mptcpintf" ] && mptcpintf="$mptcpintf $iface"
[ -z "$mptcpintf" ] && mptcpintf="$iface" [ -z "$mptcpintf" ] && mptcpintf="$iface"
[ -z "$mptcpmintf" ] && mptcpmintf="$config"
uci -q set network.${config}.defaultroute=0 uci -q set network.${config}.defaultroute=0
uci -q set network.${config}.peerdns=0 uci -q set network.${config}.peerdns=0
} }
@ -435,6 +436,7 @@ start_service() {
} }
mptcpintf="" mptcpintf=""
mptcpmintf=""
master="" master=""
count="0" count="0"
config_load openmptcprouter config_load openmptcprouter
@ -459,7 +461,7 @@ start_service() {
config_foreach add_route route6 config_foreach add_route route6
# If no master is defined, one interface is defined as master # If no master is defined, one interface is defined as master
if [ "$master" = "" ] && [ "$intf" = "" ]; then if [ "$master" = "" ] && [ "$intf" = "" ]; then
intfmaster="$(echo $mptcpintf | cut -d' ' -f1 | tr -d '\n')" intfmaster="$mptcpmintf"
[ "$intfmaster" != "" ] && { [ "$intfmaster" != "" ] && {
logger -t "MPTCP" "No master multipath defined, setting it to $intfmaster" logger -t "MPTCP" "No master multipath defined, setting it to $intfmaster"
uci -q set network.${intfmaster}.multipath="master" uci -q set network.${intfmaster}.multipath="master"