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

Fix MPTCP over VPN with WireGuard

This commit is contained in:
Ycarus (Yannick Chabanois) 2021-04-28 17:39:43 +02:00
parent 2e533166cc
commit 1455eec318
3 changed files with 21 additions and 3 deletions

View file

@ -1,7 +1,7 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2018-2020 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
START=99
START=98
STOP=10
USE_PROCD=1
EXTRA_COMMANDS="reload_rules bypass_asn"

View file

@ -643,7 +643,7 @@ interface_up=$(ifstatus "$OMR_TRACKER_INTERFACE" 2>/dev/null | jsonfilter -q -e
# An interface in error will never be used in MPTCP
if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || [ "$interface_up" != "true" ]; then
if [ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "modemmanager" ]; then
if [ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "modemmanager" ] || [ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "wireguard" ]; then
_log "No answer from $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE), restart interface"
_log "Set $OMR_TRACKER_INTERFACE down"
ifdown $OMR_TRACKER_INTERFACE

View file

@ -3,11 +3,19 @@
# Released under GPL 3. See LICENSE for the full terms.
{
START=70
START=99
STOP=10
USE_PROCD=1
}
wireguard_restart() {
local interface=$1
if [ "$(uci -q get network.${interface}.proto)" = "wireguard" ] && [ -n "$(uci -q get network.${interface}.fwmark)" ]; then
ifdown ${interface}
ifup ${interface}
fi
}
_getremoteip() {
[ "$(uci -q get openmptcprouter.$1.master)" = "1" ] && {
remoteip=$(uci -q get openmptcprouter.$1.ip | awk '{print $1}')
@ -271,6 +279,16 @@ start_service()
commit shadowsocks-libev
EOF
fi
if [ "$BOOT" = "1" ]; then
config_load network
config_foreach wireguard_restart interface
fi
}
boot() {
BOOT=1
start
}
service_triggers() {