net 34/41: netfilter conntrack - add per-net functionality for DCCP protocol

Previous thread: nefilter 40/41: nfnetlink: add nfnetlink_set_err and use it in ctnetlink by Patrick McHardy on Tuesday, March 24, 2009 - 7:04 am. (1 message)

Next thread: netfilter 35/41: xtables: add cluster match by Patrick McHardy on Tuesday, March 24, 2009 - 7:03 am. (1 message)
From: Patrick McHardy
Date: Tuesday, March 24, 2009 - 7:03 am

commit 1546000fe8db0d3f47b0ef1dd487ec23fbd95313
Author: Cyrill Gorcunov <gorcunov@openvz.org>
Date:   Mon Mar 16 16:30:49 2009 +0100

    net: netfilter conntrack - add per-net functionality for DCCP protocol
    
    Module specific data moved into per-net site and being allocated/freed
    during net namespace creation/deletion.
    
    Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
    Acked-by: Daniel Lezcano <daniel.lezcano@free.fr>
    Signed-off-by: Patrick McHardy <kaber@trash.net>

diff --git a/net/netfilter/nf_conntrack_proto_dccp.c b/net/netfilter/nf_conntrack_proto_dccp.c
index 8fcf176..d3d5a7f 100644
--- a/net/netfilter/nf_conntrack_proto_dccp.c
+++ b/net/netfilter/nf_conntrack_proto_dccp.c
@@ -16,6 +16,9 @@
 #include <linux/skbuff.h>
 #include <linux/dccp.h>
 
+#include <net/net_namespace.h>
+#include <net/netns/generic.h>
+
 #include <linux/netfilter/nfnetlink_conntrack.h>
 #include <net/netfilter/nf_conntrack.h>
 #include <net/netfilter/nf_conntrack_l4proto.h>
@@ -23,8 +26,6 @@
 
 static DEFINE_RWLOCK(dccp_lock);
 
-static int nf_ct_dccp_loose __read_mostly = 1;
-
 /* Timeouts are based on values from RFC4340:
  *
  * - REQUEST:
@@ -72,16 +73,6 @@ static int nf_ct_dccp_loose __read_mostly = 1;
 
 #define DCCP_MSL (2 * 60 * HZ)
 
-static unsigned int dccp_timeout[CT_DCCP_MAX + 1] __read_mostly = {
-	[CT_DCCP_REQUEST]	= 2 * DCCP_MSL,
-	[CT_DCCP_RESPOND]	= 4 * DCCP_MSL,
-	[CT_DCCP_PARTOPEN]	= 4 * DCCP_MSL,
-	[CT_DCCP_OPEN]		= 12 * 3600 * HZ,
-	[CT_DCCP_CLOSEREQ]	= 64 * HZ,
-	[CT_DCCP_CLOSING]	= 64 * HZ,
-	[CT_DCCP_TIMEWAIT]	= 2 * DCCP_MSL,
-};
-
 static const char * const dccp_state_names[] = {
 	[CT_DCCP_NONE]		= "NONE",
 	[CT_DCCP_REQUEST]	= "REQUEST",
@@ -393,6 +384,22 @@ dccp_state_table[CT_DCCP_ROLE_MAX + 1][DCCP_PKT_SYNCACK + 1][CT_DCCP_MAX + 1] =
 	},
 };
 
+/* this module per-net specifics */
+static int dccp_net_id;
+struct dccp_net {
+	int dccp_loose;
+	unsigned int dccp_timeout[CT_DCCP_MAX + 1];
+#ifdef ...
Previous thread: nefilter 40/41: nfnetlink: add nfnetlink_set_err and use it in ctnetlink by Patrick McHardy on Tuesday, March 24, 2009 - 7:04 am. (1 message)

Next thread: netfilter 35/41: xtables: add cluster match by Patrick McHardy on Tuesday, March 24, 2009 - 7:03 am. (1 message)