mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-12 18:41:51 +00:00
Fixes for MPTCP over VPN
This commit is contained in:
parent
0a3bd469f2
commit
489d4a3f34
3 changed files with 11 additions and 3 deletions
|
@ -298,7 +298,7 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || [ "$interface_up" != "true" ]; then
|
|||
if [ "$OMR_TRACKER_PREV_STATUS" = "$OMR_TRACKER_STATUS" ]; then
|
||||
exit 0
|
||||
fi
|
||||
[ "$multipath_status" = "off" ] || {
|
||||
[ "$multipath_status" = "off" ] && [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipathvpn)" != "1" ] || {
|
||||
if [ "$OMR_TRACKER_STATUS_MSG" = "" ]; then
|
||||
_log "$OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE) switched off"
|
||||
else
|
||||
|
@ -486,6 +486,7 @@ fi
|
|||
|
||||
multipath_config=$(uci -q get "openmtpcprouter.$OMR_TRACKER_INTERFACE.multipath")
|
||||
[ -z "$multipath_config" ] && multipath_config=$(uci -q get "network.$OMR_TRACKER_INTERFACE.multipath" || echo "off")
|
||||
[ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipathvpn)" = "1" ] && multipath_config="$(uci -q get openmptcprouter.ovpn${OMR_TRACKER_INTERFACE}.multipath)"
|
||||
if [ "$multipath_config" = "master" ]; then
|
||||
#if ([ "$default_gw" != "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$default_gw" = "" ]) && [ "$OMR_TRACKER_DEVICE_GATEWAY" != "" ] && ([ "$(uci -q get openmptcprouter.settings.master)" != "balancing" ] || [ "$(uci -q get openmptcprouter.settings.vpn)" = "mlvpn" ]); then
|
||||
if ([ "$default_gw" != "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$default_gw" = "" ]) && [ "$OMR_TRACKER_DEVICE_GATEWAY" != "" ] && [ "$(uci -q get openmptcprouter.settings.master)" != "balancing" ]; then
|
||||
|
|
|
@ -53,7 +53,7 @@ _launch_tracker() {
|
|||
config_get ifenabled "$1" auto
|
||||
config_get gateway "$1" gateway
|
||||
|
||||
[ -z "$ifname" ] || [ -z "$multipath" ] || [ "$multipath" = "off" ] && [ "$1" != "glorytun" ] && [ "$1" != "omrvpn" ] && return
|
||||
[ -z "$ifname" ] || [ -z "$multipath" ] || [ "$multipath" = "off" ] && [ "$1" != "glorytun" ] && [ "$1" != "omrvpn" ] && [ "$( uci -q get openmptcprouter.$1.multipathvpn)" != "1" ] && return
|
||||
[ "${ifenabled}" = "0" ] && return
|
||||
[ "${enabled}" = "0" ] && return
|
||||
[ -z "${hosts}" ] && [ "$type" != "none" ] && return
|
||||
|
|
|
@ -21,7 +21,7 @@ mptcp_over_vpn() {
|
|||
logger -t "MPTCPoverVPN" "Enable MPTCP over VPN for ${interface}"
|
||||
id=$(uci -q get network.${interface}.metric)
|
||||
remoteip=""
|
||||
config_load_openmptcprouter
|
||||
config_load openmptcprouter
|
||||
config_foreach _getremoteip server
|
||||
localip=$(ubus call network.interface.$interface status | jsonfilter -e '@["ipv4-address"][0].address' | tr -d "\n")
|
||||
[ -z "$(uci -q get openmptcprouter.ovpn${interface}.multipath)" ] && multipath=$(uci -q get network.${interface}.multipath)
|
||||
|
@ -64,6 +64,13 @@ mptcp_over_vpn() {
|
|||
add_list firewall.zone_vpn.network="ovpn${interface}"
|
||||
commit firewall
|
||||
EOF
|
||||
else
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
set network.${interface}.multipath='off'
|
||||
commit network
|
||||
set openmptcprouter.${interface}.multipath="off"
|
||||
commit openmptcprouter
|
||||
EOF
|
||||
fi
|
||||
elif [ "$(uci -q get openmptcprouter.ovpn${interface})" != "" ]; then
|
||||
logger -t "MPTCPoverVPN" "Disable MPTCP over VPN for ${interface}"
|
||||
|
|
Loading…
Reference in a new issue