From: Chester A. Unal Date: Sat, 2 May 2026 17:56:47 +0000 (+0100) Subject: bsbf-resources: update to GIT HEAD of 2026-05-06 X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=1e4751cdb7d750c0b8b4ee2602e0d9c9c60b54cd;p=openwrt-packages.git bsbf-resources: update to GIT HEAD of 2026-05-06 Update bsbf-resources to the GIT HEAD of 2026-05-06. - Remove bsbf-route as bsbf-mptcp now includes the functionality it provides. - Remove bsbf-plpmtu as that functionality is now provided with the plp-mtu-discovery package. - Remove bsbf-tcp-in-udp as it's not a production-ready solution as it is. - Add bsbf-client-web. - Update the dependencies of bsbf-mptcp to curl, fping, ip-full, and mptcpize. - Remove files/etc/config/bsbf-mptcp as that functionality is now provided using the /etc/bsbf/bsbf-mptcp-subflow-backup file. - Remove files/etc/hotplug.d/iface/99-bsbf-mptcp as that functionality is now provided by the bsbf-mptcp service. - Update the dependencies of bsbf-bonding to bsbf-client-web, bsbf-mptcp, bsbf-rate-limiting, and xray-core. - Get rid of fw4 dependency and 99-bsbf-bonding.nft in favour of resources-client/bsbf_bonding.nft. Add a oneshot service to apply it at boot. - Move from bsbf-openwrt-resources to bsbf-resources directory as we now install resources-client/xray.json and resources-client/bsbf_bonding.nft. - Add the bsbf-bonding command. - Run `bsbf-bonding --enable` at the end on the uci-defaults script. - Add the tc package as a dependency for bsbf-rate-limiting. Fixes: https://github.com/openwrt/packages/issues/29306 Signed-off-by: Chester A. Unal --- diff --git a/net/bsbf-openwrt-resources/Makefile b/net/bsbf-openwrt-resources/Makefile index f3a6f7e2a..9cece8d8d 100644 --- a/net/bsbf-openwrt-resources/Makefile +++ b/net/bsbf-openwrt-resources/Makefile @@ -35,20 +35,6 @@ define Package/bsbf-autoconf-dhcp/description network interface. It uses metric values from 1 to 8. endef -define Package/bsbf-bonding - SECTION:=net - CATEGORY:=Network - TITLE:=bsbf-bonding - URL:=https://github.com/bondingshouldbefree/ - DEPENDS:=+bsbf-mptcp +bsbf-plpmtu +bsbf-rate-limiting +bsbf-route \ - +bsbf-tcp-in-udp +xray-core -endef - -define Package/bsbf-bonding/description - bsbf-bonding configures the system for the BondingShouldBeFree bonding - solution client. -endef - define Build/Compile endef @@ -62,14 +48,5 @@ define Package/bsbf-autoconf-dhcp/install $(INSTALL_BIN) ./files/etc/hotplug.d/net/99-bsbf-autoconf-dhcp $(1)/etc/hotplug.d/net endef -define Package/bsbf-bonding/install - $(INSTALL_DIR) $(1)/etc/nftables.d - $(INSTALL_DATA) ./files/etc/nftables.d/99-bsbf-bonding.nft $(1)/etc/nftables.d - - $(INSTALL_DIR) $(1)/etc/uci-defaults - $(INSTALL_BIN) ./files/etc/uci-defaults/99-bsbf-bonding $(1)/etc/uci-defaults -endef - $(eval $(call BuildPackage,bsbf-autoconf-cellular)) $(eval $(call BuildPackage,bsbf-autoconf-dhcp)) -$(eval $(call BuildPackage,bsbf-bonding)) diff --git a/net/bsbf-openwrt-resources/files/etc/nftables.d/99-bsbf-bonding.nft b/net/bsbf-openwrt-resources/files/etc/nftables.d/99-bsbf-bonding.nft deleted file mode 100644 index 590842c1f..000000000 --- a/net/bsbf-openwrt-resources/files/etc/nftables.d/99-bsbf-bonding.nft +++ /dev/null @@ -1,21 +0,0 @@ -# SPDX-License-Identifier: AGPL-3.0-or-later -# Copyright (C) 2025-2026 Chester A. Unal - -set bsbf_bonding_byp4 { - typeof ip daddr - flags interval - elements = { 0.0.0.0/8, 10.0.0.0/8, - 100.64.0.0/10, 127.0.0.0/8, - 169.254.0.0/16, 172.16.0.0/12, - 192.0.0.0/24, 192.0.2.0/24, - 192.88.99.0/24, 192.168.0.0/16, - 198.18.0.0/15, 198.51.100.0/24, - 203.0.113.0/24, 224.0.0.0/4, - 240.0.0.0/4 } -} - -chain bsbf_bonding_prerouting_mangle { - type filter hook prerouting priority mangle + 1; policy accept; - ip daddr @bsbf_bonding_byp4 return - fib daddr type != local meta l4proto { tcp, udp } tproxy ip to 127.0.0.1:12345 meta mark set 0x00000001 -} diff --git a/net/bsbf-resources/Makefile b/net/bsbf-resources/Makefile index 8c625ea53..6cb0a6ed2 100644 --- a/net/bsbf-resources/Makefile +++ b/net/bsbf-resources/Makefile @@ -11,75 +11,92 @@ PKG_MAINTAINER:=Chester A. Unal PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/bondingshouldbefree/bsbf-resources.git -PKG_SOURCE_DATE:=2026-03-24 -PKG_SOURCE_VERSION:=e75046628f430c584a6f3ef12fbef4b87fad5aa4 -PKG_MIRROR_HASH:=16dd14add99ae73a473d967330509b0308076ef63e4608c78b43248a274a79a3 +PKG_SOURCE_DATE:=2026-05-06 +PKG_SOURCE_VERSION:=e80c165c77765f297aa47742de450c5dcb0f43d3 +PKG_MIRROR_HASH:=8518847ef901034548abc17317a37055c5894242b576ba64da519e4aa51b2494 include $(INCLUDE_DIR)/package.mk -define Package/bsbf-mptcp +define Package/bsbf-bonding SECTION:=net CATEGORY:=Network - TITLE:=bsbf-mptcp + TITLE:=bsbf-bonding URL:=https://github.com/bondingshouldbefree/ - DEPENDS:=+fping +ip-full + DEPENDS:=+bsbf-client-web +bsbf-mptcp +bsbf-rate-limiting +xray-core endef -define Package/bsbf-netspeed - SECTION:=net - CATEGORY:=Network - TITLE:=bsbf-netspeed - URL:=https://github.com/bondingshouldbefree/ +define Package/bsbf-bonding/description + bsbf-bonding configures the system for the BondingShouldBeFree bonding + solution client. endef -define Package/bsbf-plpmtu +define Package/bsbf-client-web SECTION:=net CATEGORY:=Network - TITLE:=bsbf-plpmtu + TITLE:=bsbf-client-web URL:=https://github.com/bondingshouldbefree/ - DEPENDS:=+fping +plp-mtu-discovery + DEPENDS:=+curl +uhttpd endef -define Package/bsbf-quectel-usbnet +define Package/bsbf-mptcp SECTION:=net CATEGORY:=Network - TITLE:=bsbf-quectel-usbnet + TITLE:=bsbf-mptcp URL:=https://github.com/bondingshouldbefree/ + DEPENDS:=+curl +fping +ip-full +mptcpize endef -define Package/bsbf-rate-limiting +define Package/bsbf-netspeed SECTION:=net CATEGORY:=Network - TITLE:=bsbf-rate-limiting + TITLE:=bsbf-netspeed URL:=https://github.com/bondingshouldbefree/ endef -define Package/bsbf-route +define Package/bsbf-quectel-usbnet SECTION:=net CATEGORY:=Network - TITLE:=bsbf-route + TITLE:=bsbf-quectel-usbnet URL:=https://github.com/bondingshouldbefree/ - DEPENDS:=+fping endef -define Package/bsbf-tcp-in-udp +define Package/bsbf-rate-limiting SECTION:=net CATEGORY:=Network - TITLE:=bsbf-tcp-in-udp + TITLE:=bsbf-rate-limiting URL:=https://github.com/bondingshouldbefree/ - DEPENDS:=+ethtool +tc-full +tcp-in-udp + DEPENDS:=+tc endef define Build/Compile endef -define Package/bsbf-mptcp/install - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_CONF) ./files/etc/config/bsbf-mptcp $(1)/etc/config +define Package/bsbf-bonding/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/etc/init.d/bsbf-bonding-nft $(1)/etc/init.d - $(INSTALL_DIR) $(1)/etc/hotplug.d/iface - $(INSTALL_BIN) ./files/etc/hotplug.d/iface/99-bsbf-mptcp $(1)/etc/hotplug.d/iface + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(INSTALL_BIN) ./files/etc/uci-defaults/99-bsbf-bonding $(1)/etc/uci-defaults + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) ./files/usr/sbin/bsbf-bonding $(1)/usr/sbin + + $(INSTALL_DIR) $(1)/usr/share/bsbf + $(INSTALL_DATA) $(PKG_BUILD_DIR)/resources-client/bsbf_bonding.nft $(1)/usr/share/bsbf + $(INSTALL_DATA) $(PKG_BUILD_DIR)/resources-client/xray.json $(1)/usr/share/bsbf +endef + +define Package/bsbf-client-web/install + $(INSTALL_DIR) $(1)/www/bsbf-client-web + $(INSTALL_DATA) $(PKG_BUILD_DIR)/resources-client/bsbf-client-web/index.html $(1)/www/bsbf-client-web + $(INSTALL_DATA) $(PKG_BUILD_DIR)/resources-client/bsbf-client-web/index.js $(1)/www/bsbf-client-web + $(INSTALL_DATA) $(PKG_BUILD_DIR)/resources-client/bsbf-client-web/styles.css $(1)/www/bsbf-client-web + + $(INSTALL_DIR) $(1)/www/cgi-bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/resources-client/bsbf-client-web/cgi-bin/bsbf-client-web $(1)/www/cgi-bin +endef + +define Package/bsbf-mptcp/install $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/etc/init.d/bsbf-mptcp $(1)/etc/init.d @@ -93,14 +110,6 @@ define Package/bsbf-netspeed/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/resources-client/bsbf-netspeed $(1)/usr/sbin endef -define Package/bsbf-plpmtu/install - $(INSTALL_DIR) $(1)/etc/hotplug.d/iface - $(INSTALL_BIN) ./files/etc/hotplug.d/iface/99-bsbf-plpmtu $(1)/etc/hotplug.d/iface - - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/resources-shared/bsbf-plpmtu $(1)/usr/sbin -endef - define Package/bsbf-quectel-usbnet/install $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/etc/init.d/bsbf-quectel-usbnet $(1)/etc/init.d @@ -114,26 +123,9 @@ define Package/bsbf-rate-limiting/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/resources-client/bsbf-rate-limiting $(1)/usr/sbin endef -define Package/bsbf-route/install - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/etc/init.d/bsbf-route $(1)/etc/init.d - - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/resources-client/bsbf-route $(1)/usr/sbin -endef - -define Package/bsbf-tcp-in-udp/install - $(INSTALL_DIR) $(1)/etc/hotplug.d/iface - $(INSTALL_BIN) ./files/etc/hotplug.d/iface/99-bsbf-tcp-in-udp $(1)/etc/hotplug.d/iface - - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/resources-client/bsbf-tcp-in-udp $(1)/usr/sbin -endef - +$(eval $(call BuildPackage,bsbf-bonding)) +$(eval $(call BuildPackage,bsbf-client-web)) $(eval $(call BuildPackage,bsbf-mptcp)) $(eval $(call BuildPackage,bsbf-netspeed)) -$(eval $(call BuildPackage,bsbf-plpmtu)) $(eval $(call BuildPackage,bsbf-quectel-usbnet)) $(eval $(call BuildPackage,bsbf-rate-limiting)) -$(eval $(call BuildPackage,bsbf-route)) -$(eval $(call BuildPackage,bsbf-tcp-in-udp)) diff --git a/net/bsbf-resources/files/etc/config/bsbf-mptcp b/net/bsbf-resources/files/etc/config/bsbf-mptcp deleted file mode 100644 index 52108d839..000000000 --- a/net/bsbf-resources/files/etc/config/bsbf-mptcp +++ /dev/null @@ -1,3 +0,0 @@ - -config endpoints 'main' -# list subflow_backup 'example' diff --git a/net/bsbf-resources/files/etc/hotplug.d/iface/99-bsbf-mptcp b/net/bsbf-resources/files/etc/hotplug.d/iface/99-bsbf-mptcp deleted file mode 100644 index 30e8f8843..000000000 --- a/net/bsbf-resources/files/etc/hotplug.d/iface/99-bsbf-mptcp +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: AGPL-3.0-or-later -# Copyright (C) 2025-2026 Chester A. Unal - -[ "$ACTION" = "ifdown" ] || exit - -DEVICE=$(ubus call network.interface."$INTERFACE" status | grep -m1 '"device"' | cut -d'"' -f4) -bsbf-mptcp-helper remove "$DEVICE" diff --git a/net/bsbf-resources/files/etc/hotplug.d/iface/99-bsbf-plpmtu b/net/bsbf-resources/files/etc/hotplug.d/iface/99-bsbf-plpmtu deleted file mode 100644 index 0d8167de6..000000000 --- a/net/bsbf-resources/files/etc/hotplug.d/iface/99-bsbf-plpmtu +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: AGPL-3.0-or-later -# Copyright (C) 2026 Chester A. Unal - -[ "$ACTION" = "ifup" ] || exit - -case "$INTERFACE" in - wan*|wwan*|ifWan*|mob*_*) - bsbf-plpmtu "$DEVICE" & - ;; -esac diff --git a/net/bsbf-resources/files/etc/hotplug.d/iface/99-bsbf-tcp-in-udp b/net/bsbf-resources/files/etc/hotplug.d/iface/99-bsbf-tcp-in-udp deleted file mode 100644 index db79b4067..000000000 --- a/net/bsbf-resources/files/etc/hotplug.d/iface/99-bsbf-tcp-in-udp +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: AGPL-3.0-or-later -# Copyright (C) 2025-2026 Chester A. Unal - -[ "$ACTION" = "ifup" ] || exit - -case "$INTERFACE" in - wan*|wwan*|ifWan*|mob*_*) - [ "$DEVICE" = qmimux* ] && { bsbf-tcp-in-udp l3 "$DEVICE"; exit; } - bsbf-tcp-in-udp l2 "$DEVICE" - ;; -esac diff --git a/net/bsbf-resources/files/etc/init.d/bsbf-bonding-nft b/net/bsbf-resources/files/etc/init.d/bsbf-bonding-nft new file mode 100644 index 000000000..fdb0f41a9 --- /dev/null +++ b/net/bsbf-resources/files/etc/init.d/bsbf-bonding-nft @@ -0,0 +1,9 @@ +#!/bin/sh /etc/rc.common +# SPDX-License-Identifier: AGPL-3.0-or-later +# Copyright (C) 2026 Chester A. Unal + +START=99 + +boot() { + /usr/sbin/nft -f /usr/share/bsbf/bsbf_bonding.nft +} diff --git a/net/bsbf-resources/files/etc/init.d/bsbf-route b/net/bsbf-resources/files/etc/init.d/bsbf-route deleted file mode 100644 index b280a89de..000000000 --- a/net/bsbf-resources/files/etc/init.d/bsbf-route +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh /etc/rc.common -# SPDX-License-Identifier: AGPL-3.0-or-later -# Copyright (C) 2025-2026 Chester A. Unal - -START=99 -USE_PROCD=1 - -start_service() { - procd_open_instance "bsbf-route" - procd_set_param command "/usr/sbin/bsbf-route" - procd_close_instance -} diff --git a/net/bsbf-openwrt-resources/files/etc/uci-defaults/99-bsbf-bonding b/net/bsbf-resources/files/etc/uci-defaults/99-bsbf-bonding similarity index 98% rename from net/bsbf-openwrt-resources/files/etc/uci-defaults/99-bsbf-bonding rename to net/bsbf-resources/files/etc/uci-defaults/99-bsbf-bonding index 8097b8b07..6a41faa8d 100644 --- a/net/bsbf-openwrt-resources/files/etc/uci-defaults/99-bsbf-bonding +++ b/net/bsbf-resources/files/etc/uci-defaults/99-bsbf-bonding @@ -50,10 +50,10 @@ uci delete network.wan uci -q delete network.wan6 fw_section=$(uci show firewall | grep "name='wan'" | cut -d. -f2) -# If firewall section for wan doesn't exist, create one. if [ -n "$fw_section" ]; then uci -q del_list firewall.$fw_section.network='wan' uci -q del_list firewall.$fw_section.network='wan6' +# If firewall section for wan doesn't exist, create one. else fw_section=$(uci add firewall zone) uci set firewall.@rule[-1].name='wan' @@ -79,7 +79,7 @@ for dev in $final_wan_interfaces; do index=$((index + 1)) done -# dnsmasq Configuration +# Configure dnsmasq. # As we don't want to use the DNS servers advertised by WANs, set up DNS # forwarding. Use 8.8.8.8 and 8.8.4.4. uci -q del_list dhcp.@dnsmasq[0].server='8.8.8.8' @@ -87,7 +87,7 @@ uci -q del_list dhcp.@dnsmasq[0].server='8.8.4.4' uci add_list dhcp.@dnsmasq[0].server='8.8.8.8' uci add_list dhcp.@dnsmasq[0].server='8.8.4.4' -# xray Configuration +# Configure xray. uci set xray.enabled.enabled='1' # Add rule to use routing table 100 for transparent proxy traffic. @@ -109,3 +109,6 @@ uci set network.@route[-1].table='100' # Commit changes. uci commit + +# Enable bonding. +bsbf-bonding --enable diff --git a/net/bsbf-resources/files/usr/sbin/bsbf-bonding b/net/bsbf-resources/files/usr/sbin/bsbf-bonding new file mode 100644 index 000000000..225107e62 --- /dev/null +++ b/net/bsbf-resources/files/usr/sbin/bsbf-bonding @@ -0,0 +1,96 @@ +#!/bin/sh +# SPDX-License-Identifier: AGPL-3.0-or-later +# Copyright (C) 2026 Chester A. Unal + +usage() { + echo "Usage: $0 --status | --enable | --disable | --uninstall" + exit 1 +} + +[ $# -ne 1 ] && usage + +case "$1" in +--status) + for service in bsbf-mptcp xray; do + service "$service" status >/dev/null || disabled=1 + done + service bsbf-bonding-nft enabled || disabled=1 + [ -n "$disabled" ] && echo "disabled" && exit 1 + echo "enabled" + ;; +--enable) + # Source /etc/bsbf/bsbf-bonding.conf. Exit if server_ipv4, server_port, + # or uuid is empty. + . /etc/bsbf/bsbf-bonding.conf + if [ -z "$server_ipv4" ] || [ -z "$server_port" ] || [ -z "$uuid" ]; then + echo "server_ipv4, server_port, and uuid on /etc/bsbf/bsbf-bonding.conf must not be empty." + exit 1 + fi + + # Configure xray. + ucode -l fs -D infile="/usr/share/bsbf/xray.json" \ + -D outfile="/etc/xray/config.json" \ + -D addr="$server_ipv4" \ + -D port="$server_port" \ + -D id="$uuid" \ + -e ' + let j = json(fs.readfile(infile)); + j.outbounds[0].settings.address = addr; + j.outbounds[0].settings.port = port; + j.outbounds[0].settings.id = id; + fs.writefile(outfile, sprintf("%.2J\n", j));' + + # Flush the MPTCP endpoint table. + ip mp e f + + # Enable and (re)start init.d services. + service bsbf-bonding-nft enable + service bsbf-mptcp enable + service xray enable + service bsbf-mptcp restart 2>/dev/null + service xray restart 2>/dev/null + + # (Re-)add nftables rules. + nft delete table bsbf_bonding 2>/dev/null + nft -f /usr/share/bsbf/bsbf_bonding.nft + ;; +--disable) + # Delete nftables rules. + nft delete table bsbf_bonding 2>/dev/null + + # Disable and stop init.d services. + service bsbf-bonding-nft disable + service bsbf-mptcp disable + service xray disable + service bsbf-mptcp stop 2>/dev/null + service xray stop 2>/dev/null + + # Delete bsbf-mptcp files. + rm -f /run/bsbf-mptcp-* + + # Flush the MPTCP endpoint table. + ip mp e f + ;; +--uninstall) + # Uninstall BSBF packages. + apk del bsbf-bonding bsbf-client-web bsbf-mptcp bsbf-rate-limiting + + # Delete nftables rules. + nft delete table bsbf_bonding 2>/dev/null + + # Restore xray. + rm -f /etc/xray/config.json + uci set xray.enabled.enabled='0' + uci commit + service xray restart 2>/dev/null + + # Delete bsbf-mptcp files. + rm -f /run/bsbf-mptcp-* + + # Flush the MPTCP endpoint table. + ip mp e f + ;; +*) + usage + ;; +esac