expr: support directional conntrack zone assignment - #364
Open
Bianzinan wants to merge 1 commit into
Open
Conversation
The kernel accepts NFTA_CT_DIRECTION for NFT_CT_ZONE on the set path (since 4.10), which is what makes per-direction zone assignment like 'ct original zone set 1' expressible. Ct only marshals the direction attribute for the address/proto keys and (opt-in) the counter keys, so directional zone assignment cannot be programmed through this library. Extend the existing OptDirection opt-in to CtKeyZONE. The zero value stays backward compatible: without the flag the attribute is omitted and the zone applies to both directions, as before. Directional zones are the standard way to NAT overlapping source networks: the zone is assigned on the original direction only, so reply lookups resolve in the default zone via the unique SNAT tuple. Verified against a live kernel: rules render as 'ct original zone set 1' in nft list ruleset; the bidirectional form is unchanged.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
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.
The kernel accepts
NFTA_CT_DIRECTIONforNFT_CT_ZONEon the set path (since 4.10), which is what makes per-direction zone assignment likect original zone set 1expressible.Ctonly marshals the direction attribute for the address/proto keys and (opt-in viaOptDirection) the counter keys, so directional zone assignment cannot be programmed through this library today.This extends the existing
OptDirectionopt-in toCtKeyZONE(two case-list additions). The zero value stays backward compatible: without the flag the attribute is omitted and the zone applies to both directions, exactly as before.Directional zones are the standard way to NAT overlapping source networks: the zone is assigned on the original direction only, so reply lookups resolve in the default zone via the unique SNAT tuple. Verified against a live kernel: rules programmed with
OptDirection: truerender asct original zone set 1innft list ruleset, and the bidirectional form is unchanged.