Skip to content

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

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

[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.

@nicolaskagami nicolaskagami self-assigned this Aug 6, 2026
@nicolaskagami
nicolaskagami marked this pull request as ready for review August 6, 2026 18:00
@nicolaskagami
nicolaskagami force-pushed the nsk/nat-3-natmap branch 2 times, most recently from 789c30c to 61774ca Compare August 7, 2026 13:47
@nicolaskagami
nicolaskagami force-pushed the nsk/nat-3-natmap branch 2 times, most recently from 020bd98 to a1b1cb9 Compare August 7, 2026 21:36
@nicolaskagami
nicolaskagami marked this pull request as draft August 7, 2026 21:49
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.
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