netfilter: cttimeout: add netns support
Subsystems (2)
Pablo Neira Ayuso
maintainerPATCH 1/1 netfilter: cttimeout: add netns support
Add a per-netns list of timeout objects and adjust code to use it.
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- include/net/net_namespace.h | 3 + include/net/netfilter/nf_conntrack_timeout.h | 2 +- net/netfilter/nf_conntrack_timeout.c | 2 +- net/netfilter/nfnetlink_cttimeout.c | 82 +++++++++++++++++----------- net/netfilter/xt_CT.c | 2 +- 5 files changed, 57 insertions(+), 34 deletions(-)
include/net/net_namespace.h +3 -0
@@ -121,6 +121,9 @@ struct net {#if IS_ENABLED (CONFIG_NETFILTER_NETLINK_ACCT )struct list_head nfnl_acct_list;#endif +#if IS_ENABLED (CONFIG_NF_CT_NETLINK_TIMEOUT ) +struct list_head nfct_timeout_list; +#endif #endif #ifdef CONFIG_WEXT_CORE struct sk_buff_head wext_nlevents;
include/net/netfilter/nf_conntrack_timeout.h +1 -1
@@ -104,7 +104,7 @@ static inline void nf_conntrack_timeout_fini(void)#endif /* CONFIG_NF_CONNTRACK_TIMEOUT */ #ifdef CONFIG_NF_CONNTRACK_TIMEOUT -extern struct ctnl_timeout *(*nf_ct_timeout_find_get_hook)(const char *name); +extern struct ctnl_timeout *(*nf_ct_timeout_find_get_hook)(struct net *net,const char *name);extern void (*nf_ct_timeout_put_hook)(struct ctnl_timeout *timeout);#endif
net/netfilter/nf_conntrack_timeout.c +1 -1
@@ -25,7 +25,7 @@#include <net/netfilter/nf_conntrack_timeout.h> struct ctnl_timeout * -(*nf_ct_timeout_find_get_hook)(const char *name)__read_mostly ; +(*nf_ct_timeout_find_get_hook)(struct net *net,const char *name)__read_mostly ;EXPORT_SYMBOL_GPL (nf_ct_timeout_find_get_hook);void (*nf_ct_timeout_put_hook)(struct ctnl_timeout *timeout)__read_mostly ;
net/netfilter/nfnetlink_cttimeout.c +51 -31
203 lines not on this page · raw message
net/netfilter/xt_CT.c +1 -1
@@ -143,7 +143,7 @@ xt_ct_set_timeout(struct nf_conn *ct, const struct xt_tgchk_param *par, goto out; } - timeout =timeout_find_get (timeout_name); + timeout =timeout_find_get (par->net, timeout_name);if (timeout ==NULL ) { ret = -ENOENT ;pr_info ("No such timeout policy \"%s\"\n" , timeout_name);
Signature · 1 line
2.1.4