Skip to content

netfilter: rework netfilter ipv6 defrag

Florian Westphal netdev netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4netfilter: ipv6: remove extra clone/free operationsinclude/net/netfilter/ipv6/nf_defrag_ipv6.h net/ipv6/netfilter/nf_conntrack_reasm.c net/ipv6/netfilter/nf_defrag_ipv6_hooks.c+9 -650 replies
2/4inet: kill obsolete skb_free opinclude/net/inet_frag.h net/ieee802154/6lowpan/reassembly.c net/ipv4/inet_fragment.c +2 more+1 -130 replies
3/4netfilter: ipv6: in-place replacement of last skbnet/ipv6/netfilter/nf_conntrack_reasm.c net/ipv6/netfilter/nf_defrag_ipv6_hooks.c net/openvswitch/conntrack.c+31 -112 replies
4/4netfilter: 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+43 -522 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/4] netfilter: rework netfilter ipv6 defrag

[ CC netdev since patch #2 isn't nf-specific. Dave, if you want
I can resubmit that one after the next nf-pull request; let me know if you would prefer that ].

Openvswitch seems broken wrt. to defragmentation, it doesn't call nf_ct_frag6_consume_orig to free the original fragments.

Moreover, openvswitch design seems to require that it can reuse current skb rather than work with a new skb pointer (it uses skb_morph for this).

Instead of OVS-side fix this series tries to alter netfilter ipv6 defrag accordingly.

1. nf_ct_frag6_consume_orig is removed, since
commit 6aafeef03b9d9ecf ("netfilter: push reasm skb through instead of original frag skbs") nothing needs the original fragments so there is no reason why we need to clone+store original skb -- just stash original skbs in the frag_list.

2. Use skb_morph to make the last skb processed (not necessarily last fragment) the reassembled one.

3. remove the no-longer needed recursion into nf_iterate, we can now just return ACCEPT/STOLEN as needed instead of NF_HOOK_THRESH()+NF_STOLEN.

Tested with flood-ping6+ fault-injection framework 'failslab' type.