vrf: rework interaction with netfilter/conntrack
Status from this message: This series was applied to netdev/net-next.git (master)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest2 patches 4 repliesApplied 2/2
- v12 patches 4 repliesSuperseded
Changes in v2 from the cover letter
- fix 'plain integer as null pointer' warning
- reword commit message in patch 2 to clarify loss of 'ct set untracked'
Patches in v2 All 2 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | netfilter: conntrack: skip confirmation and nat hooks in postrouting for vrfnet/ net/ | +27 | 0 replies | Applied |
| 2/2 | vrf: run conntrack only in context of lower/physdev for locally generated packetsdrivers/ | +24 | 4 replies | Applied |
Reviews trailers per patch
1 of 2 patches has a Reviewed-by or Acked-by.
| Patch | David Ahern |
|---|---|
| 1/2 | |
| 2/2 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 net-next 0/2] vrf: rework interaction with netfilter/conntrack
V2:
- fix 'plain integer as null pointer' warning
- reword commit message in patch 2 to clarify loss of 'ct set untracked'
This patch series aims to solve the to-be-reverted change 09e856d54bda5f288e ("vrf: Reset skb conntrack connection on VRF rcv") in a different way.
Rather than have skbs pass through conntrack and nat hooks twice, suppress conntrack invocation if the conntrack/nat hook is called from the vrf driver.
First patch deals with 'incoming connection' case:
1. suppress NAT transformations
2. skip conntrack confirmation
NAT and conntrack confirmation is done when ip/ipv6 stack calls the postrouting hook.
Second patch deals with local packets:
in vrf driver, mark the skbs as 'untracked', so conntrack output hook ignores them. This skips all nat hooks as well.
Afterwards, remove the untracked state again so the second round will pick them up.
One alternative to the chosen implementation would be to add a 'caller id' field to 'struct nf_hook_state' and then use that, these patches use the more straightforward check of VRF flag on the state->out device.
The two patches apply to both net and net-next, i am targeting -next because I think that since snat did not work correctly for so long that we can take the longer route. If you disagree, apply to net at your discretion.
The patches apply both with 09e856d54bda5f288e reverted or still in-place, but only with the revert in place ingress conntrack settings (zone, notrack etc) start working again.
I've already submitted selftests for vrf+nfqueue and conntrack+vrf.
Florian Westphal (2):
netfilter: conntrack: skip confirmation and nat hooks in postrouting
for vrf
vrf: run conntrack only in context of lower/physdev for locally
generated packets
drivers/net/vrf.c | 28 ++++++++++++++++++++++++---- net/netfilter/nf_conntrack_proto.c | 16 ++++++++++++++++ net/netfilter/nf_nat_core.c | 12 +++++++++++- 3 files changed, 51 insertions(+), 5 deletions(-)
Signature · 1 line
2.32.0