]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
netfilter: conntrack: add nf_conntrack_default_on sysctl
authorFlorian Westphal <fw@strlen.de>
Tue, 15 Nov 2016 20:36:44 +0000 (21:36 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sun, 4 Dec 2016 20:17:25 +0000 (21:17 +0100)
commit481fa3734769b67f00ed09a42f2a6a8cbd00b869
tree3a789caf579fe1bfadd0252574de42f9980518e3
parent0c66dc1ea3f0366221f8a5a16c73f01ea9259678
netfilter: conntrack: add nf_conntrack_default_on sysctl

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: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Documentation/networking/nf_conntrack-sysctl.txt
include/net/netfilter/nf_conntrack_l3proto.h
net/netfilter/nf_conntrack_proto.c
net/netfilter/nf_conntrack_standalone.c