Skip to content

netfilter: simplify nf_defrag_ipv6

Florian Westphal netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2netfilter: ipv6: nf_defrag: avoid/free clone operationsinclude/net/netfilter/ipv6/nf_defrag_ipv6.h net/ipv6/netfilter/nf_conntrack_reasm.c net/ipv6/netfilter/nf_defrag_ipv6_hooks.c +1 more+40 -860 replies
2/2netfilter: ipv6: avoid nf_iterate recursioninclude/net/netfilter/ipv6/nf_defrag_ipv6.h net/ipv6/netfilter/nf_conntrack_reasm.c net/ipv6/netfilter/nf_defrag_ipv6_hooks.c +1 more+42 -560 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH nf-next 0/2] netfilter: simplify nf_defrag_ipv6

commit 6aafeef03b9d9ecf
("netfilter: push reasm skb through instead of original frag skbs") changed ipv6 defrag to not use the original skbs anymore.

However, we still clone fragment skbs and retain original ones just to free them soon after. Since reassembled skb is newly allocated, we also need to recursively re-invoke the netfilter hooks so they can work on the reassembled skb.

This removes those clone/free operations and also avoids the hook reinvocation by morphing the reassembled skb into the last skb (i.e. the skb that completes the frag queue), just like ipv4 defrag.

include/net/netfilter/ipv6/nf_defrag_ipv6.h |    3
net/ipv6/netfilter/nf_conntrack_reasm.c     |  168 +++++++++++-----------------
net/ipv6/netfilter/nf_defrag_ipv6_hooks.c   |   20 ---
net/openvswitch/conntrack.c                 |   25 ----
4 files changed, 78 insertions(+), 138 deletions(-)