• Pablo Neira Ayuso's avatar
    netfilter: nf_conntrack: provide modparam to always register conntrack hooks · ba3fbe66
    Pablo Neira Ayuso authored
    The connection tracking hooks can be optionally registered per netns
    when conntrack is specifically invoked from the ruleset since
    0c66dc1e ("netfilter: conntrack: register hooks in netns when needed
    by ruleset"). Then, since 4d3a57f2 ("netfilter: conntrack: do not
    enable connection tracking unless needed"), the default behaviour is
    changed to always register them on demand.
    
    This patch provides a toggle that allows users to always register them.
    Without this toggle, in order to use conntrack for statistics
    collection, you need a dummy rule that refers to conntrack, eg.
    
            iptables -I INPUT -m state --state NEW
    
    This patch allows users to restore the original behaviour via modparam,
    ie. always register connection tracking, eg.
    
            modprobe nf_conntrack enable_hooks=1
    
    Hence, no dummy rule is required.
    Reported-by: default avatarLaura Garcia <nevola@gmail.com>
    Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
    ba3fbe66
nf_conntrack_standalone.c 30.6 KB