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

Fix MPTCP display

This commit is contained in:
Ycarus (Yannick Chabanois) 2022-02-02 21:27:45 +01:00
parent 5a64d743d1
commit 4c0649109d
2 changed files with 11 additions and 11 deletions

View file

@ -209,7 +209,7 @@ end
function mptcp_monitor_data()
luci.http.prepare_content("text/plain")
local fullmesh
fullmesh = io.popen("cat /proc/net/mptcp_net/snmp")
fullmesh = io.popen("multipath -m")
if fullmesh:read() ~= nil then
while true do
local ln = fullmesh:read("*l")
@ -217,16 +217,6 @@ function mptcp_monitor_data()
luci.http.write(ln)
luci.http.write("\n")
end
else
fullmesh = io.popen("nstat -z")
if fullmesh then
while true do
local ln = fullmesh:read("*l")
if not ln then break end
luci.http.write(ln)
luci.http.write("\n")
end
end
end
return
end

View file

@ -29,6 +29,7 @@ case $1 in
echo "show established conections: -c"
echo "show fullmesh info: -f"
echo "show kernel config: -k"
echo "show MPTCP info: -m"
echo
echo "Flag on the device, to enable/disable MPTCP for this interface. The backup-flag"
echo "will allow a subflow to be established across this interface, but only be used"
@ -75,6 +76,13 @@ case $1 in
fi
echo
exit 0 ;;
"-m")
if [ -f /proc/net/mptcp_net/snmp ]; then
cat /proc/net/mptcp_net/snmp
else
nstat -z | grep -i mptcp
fi
exit 0 ;;
"")
for ifpath in /sys/class/net/*; do
$0 ${ifpath##*/}
@ -126,6 +134,8 @@ else
ID=$(ip mptcp endpoint show | grep "dev $DEVICE" | awk '{print $3}')
IFF=$(ip mptcp endpoint show | grep "dev $DEVICE" | awk '{print $4}')
IP=$(ifconfig $DEVICE | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')
RMID=$(ip mptcp endpoint show | grep '::ffff' | awk '{ print $3 }')
[ -n "$RMID" ] && ip mptcp endpoint delete id $RMID 2>&1 >/dev/null
case $TYPE in
"off")
[ -n "$ID" ] && ip mptcp endpoint delete id $ID 2>&1 >/dev/null