Skip to content

expr: support directional conntrack zone assignment - #364

Open
Bianzinan wants to merge 1 commit into
google:mainfrom
Bianzinan:zone-directional
Open

expr: support directional conntrack zone assignment#364
Bianzinan wants to merge 1 commit into
google:mainfrom
Bianzinan:zone-directional

Conversation

@Bianzinan

Copy link
Copy Markdown

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 via OptDirection) the counter keys, so directional zone assignment cannot be programmed through this library today.

This extends the existing OptDirection opt-in to CtKeyZONE (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: true render as ct original zone set 1 in nft list ruleset, and the bidirectional form is unchanged.

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.
@google-cla

google-cla Bot commented Aug 13, 2026

Copy link
Copy Markdown

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.

@Bianzinan Bianzinan closed this Aug 13, 2026
@Bianzinan
Bianzinan deleted the zone-directional branch August 13, 2026 01:54
@Bianzinan
Bianzinan restored the zone-directional branch August 13, 2026 02:02
@Bianzinan Bianzinan reopened this Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant