Skip to content

luci-app-tcfilter: add tc ingress filter management - #9004

Open
mab-wien wants to merge 1 commit into
openwrt:masterfrom
mab-wien:luci-app-tcfilter
Open

luci-app-tcfilter: add tc ingress filter management#9004
mab-wien wants to merge 1 commit into
openwrt:masterfrom
mab-wien:luci-app-tcfilter

Conversation

@mab-wien

@mab-wien mab-wien commented Sep 4, 2026

Copy link
Copy Markdown

Depends on openwrt/packages#30447 (tcfilter).

Description

form.Map over /etc/config/tcfilter (global enable + a grid of
device / pref / spec / label / enabled rules) plus a live Hardware
status
table that polls tc -s -j filter show dev <dev> ingress every
5 s and shows, per rule: protocol, match summary, the skip_sw / skip_hw
flag, in_hw, action and packet count. Save & Apply re-applies the rules
via the tcfilter service's procd reload trigger.

Device list from /sys/class/net; tc is exec'd from /sbin/tc. ACL is
scoped to uci tcfilter (r/w), file list on /sys/class/net and
file exec on /sbin/tc. i18n: po/ with a German translation, .pot
generated by i18n-sync.sh.

Tested on realtek/rtl930x (Zyxel XGS1210-12).

image

Discussion / testing feedback: https://forum.openwrt.org/t/tcfilter-luci-app-tcfilter-persistent-tc-ingress-filters-with-hardware-offload-on-realtek-switches/253331

@openwrt openwrt Bot added the add package Introduces a new package Makefile build script label Sep 4, 2026
Comment thread applications/luci-app-tcfilter/root/usr/share/rpcd/acl.d/luci-app-tcfilter.json Outdated
@mab-wien
mab-wien requested a review from jow- September 4, 2026 11:08
@mab-wien

mab-wien commented Sep 4, 2026

Copy link
Copy Markdown
Author

@jow- following up on the ACL scoping fix — let me know if there's anything else, or if you have a moment to finalize the review.

Comment thread applications/luci-app-tcfilter/htdocs/luci-static/resources/view/tcfilter.js Outdated
Comment thread applications/luci-app-tcfilter/htdocs/luci-static/resources/view/tcfilter.js Outdated
Comment thread applications/luci-app-tcfilter/po/de/tcfilter.po Outdated

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit checks

  • 7dfde07 "luci-app-tcfilter: add tc ingress filter management" — the last two paragraphs describe review-round deltas ("uses widgets.DeviceSelect instead of a hand-rolled fs.list", "are now passed as single-element arrays", "the German .po is dropped") against code that never existed in the tree. For a single new-package commit, describe the end state instead.

Generated by Claude Code

Comment thread applications/luci-app-tcfilter/htdocs/luci-static/resources/view/tcfilter.js Outdated
@mab-wien

mab-wien commented Sep 6, 2026

Copy link
Copy Markdown
Author

Addressed the remaining review notes:

  • widgets.DeviceSelect now has noaliases = true, so an @network alias can't reach the tc ... dev <device> call.
  • Dropped the stray trailing blank line at EOF.
  • Rewrote the commit message to describe the end state instead of the review-round deltas.

Only the one-line noaliases change touches code; force-pushed. The ACL scoping from your earlier review is unchanged (single read-only tc ... filter show dev * ingress exec in read, uci: [tcfilter] in write).

@jow- ready for another look.

mab-wien added a commit to mab-wien/openwrt that referenced this pull request Sep 6, 2026
Pull in the fixes made on openwrt/packages#30447 and openwrt/luci#9004
since this branch was last built:
 - tcfilter: Routing and Redirection submenu, SPDX header
 - tcfilter.config: corrected HomePlug/MediaXtream prefs (49152/49153),
   mDNS at 49154/49155
 - hotplug-iface / hotplug-net: gate on /var/run/tcfilter.state
 - tcfilter.init: never truncate the state file; drop the no-op restart()
 - luci view: noaliases on the DeviceSelect, trailing newline

luci-app-tcfilter/Makefile keeps the $(TOPDIR)/feeds/luci/luci.mk
include - the package lives in package/ here, not in the luci feed.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5)
Signed-off-by: Mark Abe <github@mab.wien>
@mab-wien
mab-wien requested a review from openwrt-ai September 6, 2026 07:50
mab-wien added a commit to mab-wien/openwrt that referenced this pull request Sep 6, 2026
Stop keeping copies of net/tcfilter and applications/luci-app-tcfilter in
this branch. The workflow now checks out a fresh openwrt/openwrt buildroot
and rewrites feeds.conf to pull:

  packages -> mab-wien/packages;tcfilter
  luci     -> mab-wien/luci;luci-app-tcfilter

so every run builds exactly what is on the open PRs (openwrt/packages#30447,
openwrt/luci#9004) - no copy to keep in sync, no drift. Adds a guard that
fails if the packages don't come in from the forks, a weekly schedule and
workflow_dispatch inputs for the three refs, and records all three source
SHAs in the release notes.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5)
Signed-off-by: Mark Abe <github@mab.wien>

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commit.


Generated by Claude Code

Comment thread applications/luci-app-tcfilter/po/templates/tcfilter.pot Outdated
@mab-wien
mab-wien force-pushed the luci-app-tcfilter branch 2 times, most recently from fd631f2 to 9243beb Compare September 6, 2026 23:10
@mab-wien
mab-wien requested a review from openwrt-ai September 6, 2026 23:10

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commit; no new issues found.


Generated by Claude Code

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commit; no new issues found.


Generated by Claude Code

A form.Map over /etc/config/tcfilter (the tcfilter package's config)
plus a live status table that polls "tc -s -j filter show dev <dev>
ingress" for every device that has a rule and shows, per filter, the
match, the skip_sw / skip_hw flag, whether it sits in hardware and the
packet count. The device picker is widgets.DeviceSelect with noaliases
set, so only real netdev names reach the tc command line.

The rpcd ACL whitelists exactly one read-only call,
"tc -s -j filter show dev * ingress", in the read scope; rule changes go
through UCI, so nothing tc-related is granted for write. Status cells
that carry live tc output or UCI values are passed to E() as
single-element arrays, so they render as text nodes rather than through
innerHTML.

Only po/templates/tcfilter.pot is shipped; translations come in through
Weblate per CONTRIBUTING.md.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5)
Signed-off-by: Mark Abe <github@mab.wien>

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commit; no new issues found.


Generated by Claude Code

@mab-wien
mab-wien requested a review from openwrt-ai September 9, 2026 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

add package Introduces a new package Makefile build script

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants