nfmask, ctmask, restore_mark support + firewallchain loop fix #1234
+64
−3
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
We have been using our custom version of puppetlabs-firewall for some time because we need the nfmask, ctmask and restore_mark flags for policy based routing.
While upgrading to the latest puppetlabs-firewall, I ran into an infinite loop, creating chains all of a sudden.
As per the docs, I've written this Puppet code:
Because iptables-save doesn't always show chains like *nat or *mangle if they haven't been interacted with, the
get
function will not return those and puppetlabs-firewall will try to create the chains. However, this won't do anything and the infinite loop starts.I have 'solved' it by creating those chains manually for now and only adding them if the already existing code didn't find them.
I have verified that these changes solve my issue and that nfmask, ctmask and restore_mark work.
Because this actually is an issue that I imagine others will run into, I decided to create the PR, regardless of code quality, lack of context and knowledge.
Checklist
puppet apply
)