Skip to content

[3/3] [nat] unify per-family NAT mapping - #336

Open
nicolaskagami wants to merge 1 commit into
nsk/nat-2-nat-familyfrom
nsk/nat-3-natmap
Open

[3/3] [nat] unify per-family NAT mapping#336
nicolaskagami wants to merge 1 commit into
nsk/nat-2-nat-familyfrom
nsk/nat-3-natmap

Conversation

@nicolaskagami

@nicolaskagami nicolaskagami commented Aug 6, 2026

Copy link
Copy Markdown

This PR:

  • Introduces a NatEntry and NatMap to replace duplicated v4/v6 logic.

This is the last of 3 PRs simplifying and de-duplicating some of the nat.rs code.

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.

Left for future work:

  • Simplifying NatMap more by incorporating its Mutex and removing references to its parent Switch.

Replace the duplicated v4/v6 mapping storage and logic with a single
NatEntry type and a NatMap generic over NatAddress; the public API keeps
its per-family signatures as thin wrappers.
@nicolaskagami
nicolaskagami marked this pull request as ready for review August 6, 2026 18:00
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