• Florian Westphal's avatar
    netfilter: conntrack: add nf_conntrack_default_on sysctl · 481fa373
    Florian Westphal authored
    This switch (default on) can be used to disable automatic registration
    of connection tracking functionality in newly created network
    namespaces.
    
    This means that when net namespace goes down (or the tracker protocol
    module is unloaded) we *might* have to unregister the hooks.
    
    We can either add another per-netns variable that tells if
    the hooks got registered by default, or, alternatively, just call
    the protocol _put() function and have the callee deal with a possible
    'extra' put() operation that doesn't pair with a get() one.
    
    This uses the latter approach, i.e. a put() without a get has no effect.
    
    Conntrack is still enabled automatically regardless of the new sysctl
    setting if the new net namespace requires connection tracking, e.g. when
    NAT rules are created.
    Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
    Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
    481fa373
nf_conntrack_standalone.c 15.6 KB