mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-03 00:13:56 +08:00
This commit is contained in:
1 parent
95ded25b90
commit
6348b68a14
22 files changed
+428
-1918
No files matched your search
+1
-1
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=mptcp
|
||||
PKG_VERSION:=6.1
|
||||
PKG_RELEASE:=12
|
||||
PKG_RELEASE:=13
|
||||
|
||||
PKG_MAINTAINER:=Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
@@ -5,18 +5,34 @@
|
||||
|
||||
/etc/init.d/mptcp enabled || exit 0
|
||||
|
||||
if [ "$ACTION" = ifupdate -a -n "$IFUPDATE_ADDRESSES" ] && [ -n "$(uci -q get network.$INTERFACE.multipath)" ] && [ "$(uci -q get network.$INTERFACE.multipath)" != "off" ]; then
|
||||
# A DHCPv6 companion "<intf>_6" (wizard IPv6 SLAAC/DHCPv6 option on a DHCP
|
||||
# WAN, #4329) shares its parent's device and is kept at multipath=off so it
|
||||
# never counts as a WAN of its own (status page, MPTCP pages, trackers).
|
||||
# Its events still matter for the shared device: a new SLAAC address must
|
||||
# refresh the MPTCP endpoints, and its ifup must re-run the parent's IPv6
|
||||
# routing (mptcp reload reads the gateway from "<intf>_6" status), so the
|
||||
# multipath decision is keyed on the parent interface instead.
|
||||
MP_INTERFACE="$INTERFACE"
|
||||
case "$INTERFACE" in
|
||||
*_6)
|
||||
if [ "$(uci -q get network.$INTERFACE.proto)" = "dhcpv6" ] && [ -n "$(uci -q get network.${INTERFACE%_6})" ]; then
|
||||
MP_INTERFACE="${INTERFACE%_6}"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
MULTIPATH="$(uci -q get network.$MP_INTERFACE.multipath)"
|
||||
|
||||
if [ "$ACTION" = ifupdate -a -n "$IFUPDATE_ADDRESSES" ] && [ -n "$MULTIPATH" ] && [ "$MULTIPATH" != "off" ]; then
|
||||
logger -t "mptcp" "New IP ($IFUPDATE_ADDRESSES) for $INTERFACE ($DEVICE)"
|
||||
multipath $DEVICE off 2>&1 >/dev/null || exit 0
|
||||
multipath $DEVICE on 2>&1 >/dev/null || exit 0
|
||||
elif [ "$ACTION" = ifupdate ] && [ -n "$(uci -q get network.$INTERFACE.multipath)" ] && [ "$(uci -q get network.$INTERFACE.multipath)" != "off" ]; then
|
||||
elif [ "$ACTION" = ifupdate ] && [ -n "$MULTIPATH" ] && [ "$MULTIPATH" != "off" ]; then
|
||||
logger -t "mptcp" "Update of $INTERFACE ($DEVICE)"
|
||||
multipath $DEVICE off 2>&1 >/dev/null || exit 0
|
||||
multipath $DEVICE on 2>&1 >/dev/null || exit 0
|
||||
elif [ "$ACTION" = ifup -o "$ACTION" = iflink -o "$ACTION" = link-up ] && [ -z "$(echo $DEVICE | grep oip | grep gre)" ] && [ -n "$(uci -q get network.$INTERFACE.multipath)" ] && [ "$(uci -q get network.$INTERFACE.multipath)" != "off" ]; then
|
||||
elif [ "$ACTION" = ifup -o "$ACTION" = iflink -o "$ACTION" = link-up ] && [ -z "$(echo $DEVICE | grep oip | grep gre)" ] && [ -n "$MULTIPATH" ] && [ "$MULTIPATH" != "off" ]; then
|
||||
logger -t "mptcp" "Reloading mptcp config due to $ACTION of $INTERFACE ($DEVICE)"
|
||||
/etc/init.d/mptcp reload "$DEVICE" >/dev/null || exit 0
|
||||
elif [ "$ACTION" = ifdown -o "$ACTION" = link-down ]; then
|
||||
multipath $DEVICE off 2>&1 >/dev/null || exit 0
|
||||
fi
|
||||
|
||||
@@ -190,6 +190,27 @@ interface_max_metric() {
|
||||
esac
|
||||
}
|
||||
|
||||
# sqm-scripts (cake / htb+fq_codel / hfsc set up by /usr/lib/sqm) and
|
||||
# qos-scripts own the root qdisc of the devices they shape. Replacing it with
|
||||
# fq below silently deleted the egress shaper on every "mptcp reload <device>"
|
||||
# (tracker status change, IP change, ifup hotplug) while SQM's state file still
|
||||
# claimed it was running, so SQM never re-applied it until its next restart:
|
||||
# LuCI and the wizard showed SQM enabled, tc showed plain fq (#4329).
|
||||
# Leave the root qdisc alone whenever another shaper manages this device.
|
||||
_root_qdisc_managed_elsewhere() {
|
||||
local dev="$1" config="$2" state_dir sec
|
||||
[ -n "$dev" ] || return 1
|
||||
state_dir="$(. /etc/sqm/sqm.conf 2>/dev/null; echo "${SQM_STATE_DIR:-/var/run/sqm}")"
|
||||
[ -f "${state_dir}/${dev}.state" ] && return 0
|
||||
# an enabled sqm queue on this device: named after the interface by the
|
||||
# wizard, or an anonymous section created from the LuCI SQM page
|
||||
for sec in $(uci -q show sqm 2>/dev/null | sed -n "s/^sqm\.\([^.]*\)\.interface='${dev}'\$/\1/p"); do
|
||||
[ "$(uci -q get sqm.${sec}.enabled)" = "1" ] && return 0
|
||||
done
|
||||
[ "$(uci -q get qos.${config}.enabled)" = "1" ] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
interface_multipath_settings() {
|
||||
local mode iface proto metric ip4table qdisc
|
||||
local config="$1"
|
||||
@@ -433,7 +454,7 @@ interface_multipath_settings() {
|
||||
#ifconfig $iface txqueuelen 1000 > /dev/null 2>&1
|
||||
ip link set dev $iface txqueuelen 1000 > /dev/null 2>&1
|
||||
fi
|
||||
tc qdisc replace dev $iface root ${qdisc:-fq} > /dev/null 2>&1
|
||||
_root_qdisc_managed_elsewhere "$iface" "$config" || tc qdisc replace dev $iface root ${qdisc:-fq} > /dev/null 2>&1
|
||||
fi
|
||||
if [ -z "$gateway" ] && [ -n "$network" ]; then
|
||||
if [ "$uci_route" = "1" ]; then
|
||||
@@ -469,7 +490,7 @@ interface_multipath_settings() {
|
||||
#ifconfig $iface txqueuelen 1000 > /dev/null 2>&1
|
||||
ip link set dev $iface txqueuelen 1000 > /dev/null 2>&1
|
||||
fi
|
||||
tc qdisc replace dev $iface root ${qdisc:-fq} > /dev/null 2>&1
|
||||
_root_qdisc_managed_elsewhere "$iface" "$config" || tc qdisc replace dev $iface root ${qdisc:-fq} > /dev/null 2>&1
|
||||
fi
|
||||
if [ "$(uci -q get openmptcprouter.settings.disable_ipv6)" != "1" ] && [ "$config" != "omr6in4" ]; then
|
||||
# IPv6 Updates:
|
||||
|
||||
Reference in new issue
Block a user