diff --git a/luci-theme-vantage/Makefile b/luci-theme-vantage/Makefile index 674484970..352228de3 100644 --- a/luci-theme-vantage/Makefile +++ b/luci-theme-vantage/Makefile @@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-theme-vantage PKG_VERSION:=1.0.1 -PKG_RELEASE:=12 +PKG_RELEASE:=13 PKG_LICENSE:=GPL-3.0-or-later LUCI_TITLE:=Vantage theme diff --git a/luci-theme-vantage/htdocs/luci-static/vantage/vantage.css b/luci-theme-vantage/htdocs/luci-static/vantage/vantage.css index e7bf45d9a..2a3fd4604 100644 --- a/luci-theme-vantage/htdocs/luci-static/vantage/vantage.css +++ b/luci-theme-vantage/htdocs/luci-static/vantage/vantage.css @@ -16,7 +16,7 @@ --font: system-ui, -apple-system, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif; --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", "Cascadia Mono", system-ui, Menlo, Consolas, monospace; - --fs-micro: 11px; + --fs-micro: 11.5px; --fs-sm: 12px; --fs-base: 13px; --fs-md: 14px; diff --git a/mptcp/Makefile b/mptcp/Makefile index d6db0b88d..ebbe50948 100644 --- a/mptcp/Makefile +++ b/mptcp/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mptcp PKG_VERSION:=6.1 -PKG_RELEASE:=20 +PKG_RELEASE:=21 PKG_MAINTAINER:=Ycarus (Yannick Chabanois) PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) diff --git a/mptcp/files/etc/init.d/mptcp b/mptcp/files/etc/init.d/mptcp index 431f4ec36..fec230f04 100755 --- a/mptcp/files/etc/init.d/mptcp +++ b/mptcp/files/etc/init.d/mptcp @@ -8,6 +8,7 @@ USE_PROCD=1 . /usr/lib/unbound/iptools.sh . /lib/functions/network.sh +. /usr/lib/mptcp/init_helpers.sh restart_scheduler_dependent_services() { local proxy vpn @@ -799,11 +800,13 @@ start_service() { config_foreach add_route6 route6 [ -z "$intf" ] && set_multipath - # If no master is defined, one interface is defined as master + # If the master interface is disabled, another one is set as master. + # Not when no interface is set as master: the interfaces then share + # the balancing routes evenly, instead of 100 to 1 for a master. if [ "$master" = "" ] && [ -z "$intf" ]; then intfmaster="$mptcpmintf" - [ "$intfmaster" != "" ] && [ -z "$(uci -q show network | grep \"multipath='master'\")" ] && { - logger -t "MPTCP" "No master multipath defined, setting it to $intfmaster" + [ "$intfmaster" != "" ] && mptcp_has_master_multipath && { + logger -t "MPTCP" "Master multipath interface disabled, setting it to $intfmaster" uci -q set network.${intfmaster}.multipath="master" uci -q set openmptcprouter.${intfmaster}.multipath="master" } @@ -824,8 +827,12 @@ start_service() { stop_service() { local pin_dir="/sys/fs/bpf/mptcp" + # Deleting the pinned link unregisters the scheduler, as in + # global_multipath_settings: "bpftool struct_ops unregister" takes a map + # id or name, not a pinned path, so it failed and the pins were kept. for pin in "$pin_dir"/*; do - [ -e "$pin" ] && bpftool struct_ops unregister pinned "$pin" >/dev/null 2>&1 && rm -f "$pin" + [ -e "$pin" ] || continue + rm -f "$pin" done } diff --git a/mptcp/files/usr/bin/multipath b/mptcp/files/usr/bin/multipath index 09969f3d2..f6f6dec1f 100755 --- a/mptcp/files/usr/bin/multipath +++ b/mptcp/files/usr/bin/multipath @@ -7,7 +7,8 @@ # Released under GPL 3 or later if [ -d "/proc/sys/net/mptcp" ]; then - if ([ -f /proc/sys/net/mptcp/mptcp_enabled ] && [ `cat /proc/sys/net/mptcp/mptcp_enabled` = 0 ]) || ([ -f /proc/sys/net/mptcp/enabled ] && [ `cat /proc/sys/net/mptcp/enabled` = 0 ]); then + # read, not `cat` in two subshells: this runs on every call + if { [ -f /proc/sys/net/mptcp/mptcp_enabled ] && read -r mptcp_enabled < /proc/sys/net/mptcp/mptcp_enabled && [ "$mptcp_enabled" = 0 ]; } || { [ -f /proc/sys/net/mptcp/enabled ] && read -r mptcp_enabled < /proc/sys/net/mptcp/enabled && [ "$mptcp_enabled" = 0 ]; }; then echo "MPTCP is disabled!" exit 1 fi @@ -188,9 +189,32 @@ else } fi if [ -n "$endpoint" ]; then - ID=$(echo "${endpoint}" | sort | grep -F "dev $DEVICE " | awk '{print $3}') - IFF=$(echo "${endpoint}" | sort | grep -F -m 1 "dev $DEVICE " | awk '{print $4; exit}') - IFF2=$(echo "${endpoint}" | sort | grep -F -m 1 "dev $DEVICE " | awk '{print $5; exit}') + # The ids of the device's endpoints, and the flags of its first + # endpoint in sorted order. A sort|grep|awk pipeline for each of the + # three cost 15 processes per call, and a status query runs for every + # device ("multipath" alone lists them all): one pass over the list + # gives the same values without any when the device has one endpoint. + ep_count=0 + while IFS= read -r ep_line; do + case "$ep_line" in + *"dev $DEVICE "*) + ep_first="$ep_line" + ep_count=$((ep_count + 1)) + ;; + esac + done <