miniupnpd-nftables: reduce hook weight - #27623
Conversation
|
semicolon at eof is anachronism from when nftable include was concatenation. |
|
I'm not the maintainer. Also, you might be interested in other undergoing miniupnpd PRs. |
|
Independent from those. But thanks for advice. |
|
@brada4: @Self-Hosting-Group works on miniupnpd too. |
|
@brada4 Although I am not officially a maintainer, I would rewrite a large part of the code with the package revisions PR. Yes, the |
|
A If you remove parameter it takes default value, never accessed, but you will never know. Patching it out and maintaining would be excess work. B Rationale about forward - if you add a single dnat rule then status dnat is added in all traversed chains, I do same. Can be chain-pre even (subject to re-arrangement in my own making ) at present you can only prepend before ct state dispatch which would add 1mm damage to general traffic. C It does a weird matching all attributes in payload, so I guard it to push only new connections through essentially conntrack reimplementation. You could take them all as immediate ct meta https://wiki.nftables.org/wiki-nftables/index.php/Matching_connection_tracking_stateful_metainformation#Conntrack-assigned_metadata (you do not carry the badge of maintainer, but as a matter of fact you are the only one doing the practical plumbing part) |
No shit sherlock, rebase from web ui cripples commit author. |
7477863 to
7c7f8da
Compare
|
Dont you dare to complain about removed version bump. |
|
Dear OpenWRT devlopers, |
openwrt-ai
left a comment
There was a problem hiding this comment.
Reviewed 1 commit; inline comments below. Not a backport; the commit message accurately describes the ruleset changes, so no commit-message discrepancies. CI is green.
Generated by Claude Code
Formality Check: Suggestions AvailableWe checked this pull request against the contribution guidelines. Here is what needs your attention:
|
Thats not what other clanker said. |
openwrt-ai
left a comment
There was a problem hiding this comment.
Reviewed the updated revision. The tree is byte-identical to the previously reviewed commit (7c7f8da); only the commit message changed, so the earlier inline comments still apply and no new code issues were found.
Commit checks
- The reworded message drops the bullet that documented the prerouting hook change, but the diff still adds
ct state newtochain-post/dstnat/20-miniupnpd.nft(restricting thejump upnp_preroutingto new connections). Consider restoring a line describing that change so the message fully reflects the diff.
Generated by Claude Code
|
This just addresses heaviest integration point, instead of addressing upstream pessimalities just waling around them The rules from miniupnpd extracts meta nfproto . meta l4proto . ct original-proto-dst by reading each bit from the packet for each forwarded port , since it is programmed directly via kernel netlink the CLI heuristics and mini optimisations stand no chance. Besides miniupnp-generated rules fail validation as parsed back. Ignoring that they still do what they are supposed to albeit at 10x cost. |
openwrt-ai
left a comment
There was a problem hiding this comment.
Reviewed the updated revision. The tree is byte-identical to the previously reviewed commit (4be3d3d3); the only change is the commit message, which now re-adds the bullet "skip heavy payload expressions in miniupnpd rules by emulating nat type hook by selecting only new flows as candidates". That documents the ct state new addition in chain-post/dstnat/20-miniupnpd.nft and resolves the point raised in my previous review, so the message now fully reflects the diff. No new code changes and no new issues found.
Generated by Claude Code
|
In my daemon PR, I removed the FYI: Your suggested changes to reduce hook weight added to my PR worked in a test. Found some nits in the commit message: miniupnp -> miniupnpd, and some redundancy. |
|
I will adj&st and compare. |
Reduce usage of resources of miniupnp ruleset - eliminate postrouting hook as miniupnpd never creates rules there - but leave unreachable chain referenced in config file - skip forward chain using ct-based heuristics just like default firewall - but leave unreachable chain referenced in config file - avoid non-transactional prerouting+forward updates creating out of sync ruleset - skip heavy payload expressions in miniupnpd rules by emulating nat type hook by selecting only new flows as candidates - remove chain unused by miniupnpd Signed-off-by: Andris PE <neandris@gmail.com>
Reduce usage of resources of miniupnp ruleset
Fixes: #29712
📦 Package Details
Maintainer: @Self-Hosting-Group
Description: Forwards ports, post PR using less resources to do so
🧪 Run Testing Details
✅ Formalities
If your PR contains a patch:
git amThe idea is upstreamable, patched ruleset hooks bypass misteaks