luci-app-firewall: drop unused TCP CCA option - #418
Open
leochien0102 wants to merge 1 commit into
Open
leochien0102 wants to merge 1 commit into
leochien0102 wants to merge 1 commit into
Conversation
a3ac471 ("luci-app-firewall: add bbr option for fw3/fw4") added a "TCP CCA" list to the zone page that stores firewall.@defaults[0].tcpcca, but nothing reads that option: neither fw3 nor fw4, nor any init script, hotplug handler or uci-defaults in LEDE or this feed. Picking bbr leaves net.ipv4.tcp_congestion_control untouched, and since 26d2f86 the page shows the real value right above the list, so the two visibly disagree. The option also misleads in smaller ways. With rmempty = false and a default of cubic, saving the page writes "option tcpcca 'cubic'" even when the list was never touched. The default ignores kmod-tcp-bbr, whose sysctl.d file switches the kernel to bbr at boot, and the fixed bbr/cubic/reno choices ignore what the kernel actually offers. luci-app-turboacc already owns this setting: it lists the available algorithms, pulls in kmod-tcp-bbr, and applies turboacc.config.tcpcca with sysctl in start_service. Unlike fullcone and flow_offloading it does not mirror the value into the firewall config, so wiring up the firewall option as well would give one sysctl two competing owners. Remove the list and its now unused zh_Hans strings. The runtime status line stays and remains the accurate read-only view. Existing tcpcca entries in /etc/config/firewall have no reader and are left alone. Signed-off-by: leochien0102 <leochien0102@gmail.com>
leochien0102
added a commit
to leochien0102/openwrt-actions
that referenced
this pull request
Sep 14, 2026
coolsnowwolf/luci 26d2f86ae2 added a runtime NAT / TCP CCA status line to the zone page and inserted its setup code directly in front of the addTCPCCAOption closure. The first hunk lost its context, patch failed, and the build stopped at apply_patches. That commit only displays the live sysctl value; the dropdown still has no reader, so the removal stands. The diff body is regenerated against the current feed and keeps the status line. The description gains a paragraph on 26d2f86ae2 and points at coolsnowwolf/luci#418, the same change proposed upstream -- once it merges this patch is reported as already applied and can be deleted.
leochien0102
added a commit
to leochien0102/openwrt-actions
that referenced
this pull request
Sep 14, 2026
coolsnowwolf/luci 26d2f86ae2 added a runtime NAT / TCP CCA status line to the zone page and inserted its setup code directly in front of the addTCPCCAOption closure. The first hunk lost its context, patch failed, and the build stopped at apply_patches. That commit only displays the live sysctl value; the dropdown still has no reader, so the removal stands. The diff body is regenerated against the current feed and keeps the status line. The description gains a paragraph on 26d2f86ae2 and points at coolsnowwolf/luci#418, the same change proposed upstream -- once it merges this patch is reported as already applied and can be deleted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
a3ac471c96(luci-app-firewall: add bbr option for fw3/fw4)在「防火墙 → 区域设置 → 常规设置」中加入了「TCP 拥塞控制算法」下拉框(bbr / cubic / reno)。它会把firewall.@defaults[0].tcpcca写进 uci,但没有任何代码读取这个选项,选择后不会改变系统实际使用的算法。排查范围与结果:
tcpcca,只有两处用到:luci-app-turboacc:读取的是自己的turboacc.config.tcpcca,不是 firewall 下的这个选项;26d2f86ae2新增的运行状态行:只读取/proc/sys/net/ipv4/tcp_congestion_control用于显示。firewall、firewall4包、init 脚本、hotplug、uci-defaults 里都没有读取这个选项的代码;a3ac471c96之后也没有任何提交涉及tcpcca。fw3 和 fw4 都一样。现象
net.ipv4.tcp_congestion_control不变。26d2f86ae2加入运行状态行之后,这个矛盾直接显示在同一个页面上:下拉框显示 BBR,上方状态行显示当前算法是 CUBIC。rmempty = false和default = 'cubic',而配置里原本没有这个值(cfgvalue为空),表单值是'cubic',两者不等,AbstractValue.parse()就会写入。所以只要在这个页面点一次「保存」,即使没碰过下拉框,/etc/config/firewall里也会多出一行option tcpcca 'cubic'。kmod-tcp-bbr会安装/etc/sysctl.d/12-tcp-bbr.conf,开机时把算法设为 bbr;此时下拉框仍默认显示 cubic。kmod-tcp-bbr时也能选 bbr。为什么删除,而不是补上后端
luci-app-turboacc的选项列表来自tcp_available_congestion_control,通过PACKAGE_TURBOACC_INCLUDE_BBR_CCA依赖kmod-tcp-bbr,并在start_service中执行sysctl -w net.ipv4.tcp_congestion_control="$tcpcca"。fullcone、flow_offloading同步写进firewall.@defaults[0],但tcpcca例外,它直接改 sysctl,不经过 firewall。如果防火墙这边也去改 sysctl,同一个值就有两个来源,谁最后执行谁生效,结果不可预期。删除后页面恢复一致:
26d2f86ae2的运行状态行继续如实显示当前算法;需要修改时使用 turboacc 或/etc/sysctl.conf。改动
zones.js:删除addTCPCCAOption及两处调用(fullcone 分支内和else分支)。po/zh_Hans/firewall.po:删除随之失效的TCP CCA、TCP congestion control algorithm.两条翻译。/usr/libexec/luci-firewall-status和 ACL 保持不变;FullCone 相关选项不受影响。option tcpcca的旧配置不需要迁移:本来就没有代码读取它,留着不影响任何行为。验证
origin/openwrt-25.12(725ddc051f)上改动,zones.js通过语法检查。26d2f86ae2之前的代码),已经实际刷机运行。本 PR 是在26d2f86ae2之后的代码上重新整理的版本。Signed-off-by: <my@email.address>row (viagit commit --signoff)<package name>: titlefirst line subject for packagesPKG_VERSIONin the Makefile —— 不适用:luci-app-firewall 的 Makefile 没有PKG_VERSION,版本由 luci.mk 根据 git 自动生成