Raise fw4 open-file limit - #1870
Open
gsanchietti wants to merge 1 commit into
Open
Conversation
Applying a large firewall configuration failed part way through and the new rules were silently discarded, leaving the previous ones active while the command still reported success. Building the rules holds one file open per rule template until the whole set is finished, so a large configuration exceeds the limit of 1024 open files. A 320-section configuration needs about 1060. PKG_RELEASE is bumped so the rebuilt package is a visible upgrade and can reach existing installations without a new image. Refs #1869 Assisted-by: Claude Code:claude-sonnet-5
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.
Summary
On firewalls with many port forwards and zones, applying the firewall
configuration failed part way through. The incomplete rules were then
discarded, so the firewall kept its previous rules while the command still
reported success — changes appeared to work but did not take effect.
Building the rules holds one file open per rule template until the whole set
is finished, which exceeds the limit of 1024 open files. The patch raises that
limit in
/sbin/fw4, the single place every reload goes through (boot,hotplug, API, manual runs).
PKG_RELEASEis bumped too, so the rebuilt package counts as an upgrade andcan be shipped to existing installations without releasing a new image.
Related issue: #1869
How to test
Issue #1869 has a script that builds a firewall configuration large enough to
trigger the problem. On a test machine, run it and then
fw4 reload:No file descriptors available, and the newrules are not applied (
nft list table inet fw4 | grep -c "dnat ip to"isunchanged)
Note
fw4 reloadexits 0 in both cases, so check the printed output ratherthan the exit status.
To test on a real machine:
Still to confirm
Whether the
distfeed.nethesis.itsubscription mirror carries thebasefeed. If it only mirrors
nethsecurity, subscription units would need a newimage and this should get the
needs imagelabel.