netfilter: disable defrag once its no longer needed
authorFlorian Westphal <fw@strlen.de>
Wed, 21 Apr 2021 07:45:40 +0000 (09:45 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 26 Apr 2021 01:20:07 +0000 (03:20 +0200)
commitde8c12110a130337c8e7e7b8250de0580e644dee
tree6cfc80f96c19a60753a15a99e906996e2f0b499c
parente0bb96db96f8ca94349344a2ea7bebc6f8cefdae
netfilter: disable defrag once its no longer needed

When I changed defrag hooks to no longer get registered by default I
intentionally made it so that registration can only be un-done by unloading
the nf_defrag_ipv4/6 module.

In hindsight this was too conservative; there is no reason to keep defrag
on while there is no feature dependency anymore.

Moreover, this won't work if user isn't allowed to remove nf_defrag module.

This adds the disable() functions for both ipv4 and ipv6 and calls them
from conntrack, TPROXY and the xtables socket module.

ipvs isn't converted here, it will behave as before this patch and
will need module removal.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/ipv4/nf_defrag_ipv4.h
include/net/netfilter/ipv6/nf_defrag_ipv6.h
net/ipv4/netfilter/nf_defrag_ipv4.c
net/ipv6/netfilter/nf_defrag_ipv6_hooks.c
net/netfilter/nf_conntrack_proto.c
net/netfilter/nft_tproxy.c
net/netfilter/xt_TPROXY.c
net/netfilter/xt_socket.c