All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Yasuyuki KOZAKAI <yasuyuki.kozakai@toshiba.co.jp>
Cc: netfilter-devel@lists.netfilter.org, kadlec@blackhole.kfki.hu
Subject: Re: [NETFILTER 02/05]: nf_conntrack: automatic sysctl registation for conntrack protocols
Date: Mon, 27 Nov 2006 11:38:44 +0100	[thread overview]
Message-ID: <456AC034.9090701@trash.net> (raw)
In-Reply-To: <456ABE55.1050800@trash.net>

[-- Attachment #1: Type: text/plain, Size: 1112 bytes --]

Patrick McHardy wrote:
> diff --git a/net/netfilter/nf_conntrack_proto.c b/net/netfilter/nf_conntrack_proto.c
> index 0afc298..941b5c3 100644
> --- a/net/netfilter/nf_conntrack_proto.c
> +++ b/net/netfilter/nf_conntrack_proto.c
> @@ -173,7 +173,7 @@ static void nf_ct_l3proto_unregister_sys
>  {
>  #ifdef CONFIG_SYSCTL
>  	mutex_lock(&nf_ct_proto_sysctl_mutex);
> -	if (l3proto->ctl_table != NULL)
> +	if (l3proto->ctl_table_header != NULL)
>  		nf_ct_unregister_sysctl(&l3proto->ctl_table_header,
>  					l3proto->ctl_table, NULL);
>  	mutex_unlock(&nf_ct_proto_sysctl_mutex);
> @@ -260,7 +260,8 @@ static void nf_ct_l4proto_unregister_sys
>  {
>  #ifdef CONFIG_SYSCTL
>  	mutex_lock(&nf_ct_proto_sysctl_mutex);
> -	if (l4proto->ctl_table != NULL)
> +	if (l4proto->ctl_table_header != NULL &&
> +	    *l4proto->ctl_table_header != NULL)
>  		nf_ct_unregister_sysctl(l4proto->ctl_table_header,
>  					l4proto->ctl_table,
>  					l4proto->ctl_table_users);

And a simiar change for the compat stuff, but I've also removed the
double pointer for the header since the compat tables are not supposed
to be shared.

[-- Attachment #2: x --]
[-- Type: text/plain, Size: 5508 bytes --]

diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h
index 5c72118..fc8af08 100644
--- a/include/net/netfilter/nf_conntrack_l4proto.h
+++ b/include/net/netfilter/nf_conntrack_l4proto.h
@@ -81,7 +81,7 @@ #ifdef CONFIG_SYSCTL
 	struct ctl_table	*ctl_table;
 	unsigned int		*ctl_table_users;
 #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
-	struct ctl_table_header	**ctl_compat_table_header;
+	struct ctl_table_header	*ctl_compat_table_header;
 	struct ctl_table	*ctl_compat_table;
 #endif
 #endif
diff --git a/net/ipv4/netfilter/nf_conntrack_proto_icmp.c b/net/ipv4/netfilter/nf_conntrack_proto_icmp.c
index e97e288..46aa44a 100644
--- a/net/ipv4/netfilter/nf_conntrack_proto_icmp.c
+++ b/net/ipv4/netfilter/nf_conntrack_proto_icmp.c
@@ -337,7 +337,6 @@ static struct ctl_table icmp_sysctl_tabl
 	}
 };
 #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
-static struct ctl_table_header *icmp_compat_sysctl_header;
 static struct ctl_table icmp_compat_sysctl_table[] = {
 	{
 		.ctl_name	= NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT,
@@ -377,7 +376,6 @@ #ifdef CONFIG_SYSCTL
 	.ctl_table_header	= &icmp_sysctl_header,
 	.ctl_table		= icmp_sysctl_table,
 #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
-	.ctl_compat_table_header= &icmp_compat_sysctl_header,
 	.ctl_compat_table	= icmp_compat_sysctl_table,
 #endif
 #endif
diff --git a/net/netfilter/nf_conntrack_proto.c b/net/netfilter/nf_conntrack_proto.c
index d686bb4..4798afc 100644
--- a/net/netfilter/nf_conntrack_proto.c
+++ b/net/netfilter/nf_conntrack_proto.c
@@ -255,7 +255,7 @@ #ifdef CONFIG_SYSCTL
 	}
 #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
 	if (l4proto->ctl_compat_table != NULL) {
-		err = nf_ct_register_sysctl(l4proto->ctl_compat_table_header,
+		err = nf_ct_register_sysctl(&l4proto->ctl_compat_table_header,
 					    nf_net_ipv4_netfilter_sysctl_path,
 					    l4proto->ctl_compat_table, NULL);
 		if (err == 0)
@@ -281,8 +281,8 @@ #ifdef CONFIG_SYSCTL
 					l4proto->ctl_table,
 					l4proto->ctl_table_users);
 #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
-	if (l4proto->ctl_compat_table != NULL)
-		nf_ct_unregister_sysctl(l4proto->ctl_compat_table_header,
+	if (l4proto->ctl_compat_table_header != NULL)
+		nf_ct_unregister_sysctl(&l4proto->ctl_compat_table_header,
 					l4proto->ctl_compat_table, NULL);
 #endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */
 	mutex_unlock(&nf_ct_proto_sysctl_mutex);
diff --git a/net/netfilter/nf_conntrack_proto_generic.c b/net/netfilter/nf_conntrack_proto_generic.c
index 8df3bc6..6990253 100644
--- a/net/netfilter/nf_conntrack_proto_generic.c
+++ b/net/netfilter/nf_conntrack_proto_generic.c
@@ -87,7 +87,6 @@ static struct ctl_table generic_sysctl_t
 	}
 };
 #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
-static struct ctl_table_header *generic_compat_sysctl_header;
 static struct ctl_table generic_compat_sysctl_table[] = {
 	{
 		.ctl_name	= NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT,
@@ -119,7 +118,6 @@ #ifdef CONFIG_SYSCTL
 	.ctl_table_header	= &generic_sysctl_header,
 	.ctl_table		= generic_sysctl_table,
 #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
-	.ctl_compat_table_header= &generic_compat_sysctl_header,
 	.ctl_compat_table	= generic_compat_sysctl_table,
 #endif
 #endif
diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c
index 807d215..7c64b9c 100644
--- a/net/netfilter/nf_conntrack_proto_sctp.c
+++ b/net/netfilter/nf_conntrack_proto_sctp.c
@@ -575,7 +575,6 @@ static struct ctl_table sctp_sysctl_tabl
 };
 
 #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
-static struct ctl_table_header *sctp_compat_sysctl_header;
 static struct ctl_table sctp_compat_sysctl_table[] = {
 	{
 		.ctl_name	= NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED,
@@ -656,7 +655,6 @@ #ifdef CONFIG_SYSCTL
 	.ctl_table_header	= &sctp_sysctl_header,
 	.ctl_table		= sctp_sysctl_table,
 #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
-	.ctl_compat_table_header= &sctp_compat_sysctl_header,
 	.ctl_compat_table	= sctp_compat_sysctl_table,
 #endif
 #endif
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
index 6fcf388..d99c7c4 100644
--- a/net/netfilter/nf_conntrack_proto_tcp.c
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
@@ -1275,7 +1275,6 @@ static struct ctl_table tcp_sysctl_table
 };
 
 #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
-static struct ctl_table_header *tcp_compat_sysctl_header;
 static struct ctl_table tcp_compat_sysctl_table[] = {
 	{
 		.ctl_name	= NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT,
@@ -1404,7 +1403,6 @@ #ifdef CONFIG_SYSCTL
 	.ctl_table_header	= &tcp_sysctl_header,
 	.ctl_table		= tcp_sysctl_table,
 #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
-	.ctl_compat_table_header= &tcp_compat_sysctl_header,
 	.ctl_compat_table	= tcp_compat_sysctl_table,
 #endif
 #endif
diff --git a/net/netfilter/nf_conntrack_proto_udp.c b/net/netfilter/nf_conntrack_proto_udp.c
index 75c1e45..908fde7 100644
--- a/net/netfilter/nf_conntrack_proto_udp.c
+++ b/net/netfilter/nf_conntrack_proto_udp.c
@@ -173,7 +173,6 @@ static struct ctl_table udp_sysctl_table
 	}
 };
 #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
-static struct ctl_table_header *udp_compat_sysctl_header;
 static struct ctl_table udp_compat_sysctl_table[] = {
 	{
 		.ctl_name	= NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT,
@@ -220,7 +219,6 @@ #ifdef CONFIG_SYSCTL
 	.ctl_table_header	= &udp_sysctl_header,
 	.ctl_table		= udp_sysctl_table,
 #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
-	.ctl_compat_table_header= &udp_compat_sysctl_header,
 	.ctl_compat_table	= udp_compat_sysctl_table,
 #endif
 #endif

  reply	other threads:[~2006-11-27 10:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-26 14:44 [NETFILTER 00/05]: nf_conntrack: proc/sysctl compatibility Patrick McHardy
2006-11-26 14:44 ` [NETFILTER 01/05]: nf_conntrack: move extern declaration to header files Patrick McHardy
2006-11-26 14:44 ` [NETFILTER 02/05]: nf_conntrack: automatic sysctl registation for conntrack protocols Patrick McHardy
2006-11-27  5:17   ` Yasuyuki KOZAKAI
     [not found]   ` <200611270517.kAR5HMV3029948@toshiba.co.jp>
2006-11-27 10:30     ` Patrick McHardy
2006-11-27 10:38       ` Patrick McHardy [this message]
2006-11-26 14:44 ` [NETFILTER 03/05]: nf_conntrack: move conntrack protocol sysctls to individual modules Patrick McHardy
2006-11-27  5:27   ` Yasuyuki KOZAKAI
     [not found]   ` <200611270527.kAR5RLHM003180@toshiba.co.jp>
2006-11-27 10:32     ` Patrick McHardy
2006-11-26 14:44 ` [NETFILTER 04/05]: nf_conntrack: sysctl compatibility with old connection tracking Patrick McHardy
2006-11-26 14:44 ` [NETFILTER 05/05]: nf_conntrack: /proc " Patrick McHardy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=456AC034.9090701@trash.net \
    --to=kaber@trash.net \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=yasuyuki.kozakai@toshiba.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.