Skip to contentSkip to conversation

netfilter: cttimeout: add netns support

PATCH New Pablo Neira Ayuso 1 participant 1 message Dec 9, 2015

Subsystems (2)
lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 netfilter: cttimeout: add netns support

Add a per-netns list of timeout objects and adjust code to use it.

---
 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
index 2dcea63..4089abc 100644
@@ -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
index f72be38..5cc5e9e 100644
@@ -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
index 93da609..26e7420 100644
@@ -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
index e7ac07e..6669e68 100644
@@ -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