[1/3] [nat] move PortRange to struct - #334
Merged
Merged
Conversation
nicolaskagami
force-pushed
the
nsk/nat-1-portrange
branch
from
August 6, 2026 12:13
76fd9df to
a01c3aa
Compare
This was referenced Aug 6, 2026
nicolaskagami
marked this pull request as ready for review
August 6, 2026 18:00
nicolaskagami
requested review from
internet-diglett,
rcgoodfellow and
taspelund
August 6, 2026 18:10
internet-diglett
left a comment
Contributor
There was a problem hiding this comment.
Overall looks good! Just a few comments.
nicolaskagami
force-pushed
the
nsk/nat-1-portrange
branch
from
August 7, 2026 12:48
a01c3aa to
d7008db
Compare
taspelund
requested changes
Aug 7, 2026
nicolaskagami
force-pushed
the
nsk/nat-1-portrange
branch
from
August 7, 2026 18:48
d7008db to
25b94af
Compare
taspelund
approved these changes
Aug 7, 2026
taspelund
left a comment
Contributor
There was a problem hiding this comment.
LGTM, although I'd like to see an approval from @internet-diglett as well before merging
internet-diglett
approved these changes
Aug 7, 2026
nicolaskagami
added a commit
that referenced
this pull request
Aug 14, 2026
This PR: - Introduces a `NatAddress` trait, tying each IP address family to its p4 table, match key, and action types. Replaces duplicated per-family entry points. - Fixes a bug where we'd clear our internal representation of the mappings if the underlying code failed to reset. This is the second of 3 PRs simplifying and de-duplicating some of the `nat.rs` code. - #334 - #335 - #336 Obs: Changes are almost entirely equivalent, except for the ordering of some things and the log message `nat tables` -> `nat table`.
nicolaskagami
added a commit
that referenced
this pull request
Aug 14, 2026
This PR: - Introduces a `NatEntry` and `NatMap` to replace duplicated v4/v6 logic (net -203 LOC). This is the last of 3 PRs simplifying and de-duplicating some of the `nat.rs` code. - #334 - #335 - #336 Obs: - I decided to upgrade the IPv6 log error from `trace` to `error` to match the IPv4 one but I'm happy to do it the other way around. - Renamed `ipv4_generation` to `generation`, since it applies to both even though the nexus API nomenclature is out-of-date.
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.
This PR:
PortRangetrait into a struct, validating thelow <= highinvariant by construction.overlapfunction.This is the first of 3 PRs simplifying and de-duplicating some of the
nat.rscode.PortRangeto struct #334NatAddresstrait #335Left for future work:
PortRangeusage further.