Repository navigation
Fix virtual router nftables restore at boot - #14621
Open
MitchDrage wants to merge 1 commit into
Open
MitchDrage wants to merge 1 commit into
MitchDrage wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Description
This PR fixes the virtual router's nftables restore at boot.
rules.nftableswas saved withnft list ruleset, which includes the iptables-nft tables. nft can't load those, so the whole restore failed and the IPv6 firewall and ACLs were missing after a reboot from the router's shell.CsHelper.save_nftablessaves every table except the iptables ones (filter,nat,mangle,raw,security) and ebtables'broute. The router's iptables rules are already saved inrules.v4andrules.v6and restored with iptables-restore.configure.pyuses it in place ofnft list ruleset.save_iptablesandsave_nftablesnow share a smallwrite_lineshelper.The iptables table names are fixed, so I chose to exclude those over naming the tables to keep. The set of nftables tables can grow, and #14620 adds one, for example.
Fixes: #14619
Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
TestCsHelper: iptables tables andbrouteare left out, the IPv6 firewall, IPv4 routed firewall and other tables are kept, a router with only iptables tables gets an empty file, andsave_iptablesstill writes theiptables-saveoutput unchanged.postinit.sh, as a boot would:main)IPv4 iptables rules were identical before and after the boot in every run.
How did you try to break this feature and the system with this change?