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

Add check on VPS and IP timeout config in web interface and add loop detection

This commit is contained in:
Ycarus (Yannick Chabanois) 2021-05-19 19:37:17 +02:00
parent 6702b125ca
commit 4c56f5402f
10 changed files with 111 additions and 12 deletions

View file

@ -1124,6 +1124,35 @@ if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($(
[ -n "$asn" ] && {
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.asn="$asn"
}
# Routing loop detection
local lanip="$(uci -q network.lan.ipaddr)"
local masterip
get_master_ip() {
if [ "$(openmptcprouter.$1.multipath)" = "master" ]; then
masterip="$(uci -q get openmptcprouter.$1.publicip)"
fi
}
config_load openmptcprouter
config_foreach get_master_ip interface
if [ -n "$lanip" ] && [ -n "$masterip" ] && [ -n "$ipaddr" ] && [ "$ipaddr" = "$masterip" ] && [ "$(uci -q get openmptcprouter.settings.disableloopdetection)" != "1" ]; then
loop=0
routingloop() {
if [ "$(omr-routing-loop $1 $lanip)" = "detected" ]; then
loop=1
fi
}
config_load openmptcprouter
config_foreach routingloop server
if [ "$loop" = "1" ]; then
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.loop='1'
else
uci -q delete openmptcprouter.$OMR_TRACKER_INTERFACE.loop
fi
else
uci -q delete openmptcprouter.$OMR_TRACKER_INTERFACE.loop
fi
local omrtracebox
traceboxmtutest() {
omr_tracebox_mtu() {