All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wang Weidong <wangweidong1@huawei.com>
To: <nhorman@tuxdriver.com>, <davem@davemloft.net>, <vyasevich@gmail.com>
Cc: <dborkman@redhat.com>, <sergei.shtylyov@cogentembedded.com>,
	<netdev@vger.kernel.org>
Subject: [PATCH v3 1/2] sctp: fix a missed .data initialization
Date: Wed, 12 Feb 2014 09:44:43 +0800	[thread overview]
Message-ID: <1392169484-8256-2-git-send-email-wangweidong1@huawei.com> (raw)
In-Reply-To: <1392169484-8256-1-git-send-email-wangweidong1@huawei.com>

As commit 3c68198e75111a90("sctp: Make hmac algorithm selection for
 cookie generation dynamic"), we miss the .data initialization.
If we don't use the net_namespace, the problem that parts of the
sysctl configuration won't be isolation and won't occur.

In sctp_sysctl_net_register(), we register the sysctl for each
net, in the for(), we use the 'table[i].data' as check condition, so
when the 'i' is the index of sctp_hmac_alg, the data is NULL, then
break. So add the .data initialization.

Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
---
 net/sctp/sysctl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c
index 7135e61..d354de5 100644
--- a/net/sctp/sysctl.c
+++ b/net/sctp/sysctl.c
@@ -151,6 +151,7 @@ static struct ctl_table sctp_net_table[] = {
 	},
 	{
 		.procname	= "cookie_hmac_alg",
+		.data		= &init_net.sctp.sctp_hmac_alg,
 		.maxlen		= 8,
 		.mode		= 0644,
 		.proc_handler	= proc_sctp_do_hmac_alg,
-- 
1.7.12

  reply	other threads:[~2014-02-12  1:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-12  1:44 [PATCH v3 0/2] sctp: fix a problem with net_namespace Wang Weidong
2014-02-12  1:44 ` Wang Weidong [this message]
2014-02-12  1:44 ` [PATCH v3 2/2] sctp: optimize the sctp_sysctl_net_register Wang Weidong
2014-02-12 11:53   ` Neil Horman
2014-02-13  1:19     ` Wang Weidong
2014-02-13 12:44       ` Neil Horman
2014-02-14  2:18         ` Wang Weidong
2014-02-13 22:13 ` [PATCH v3 0/2] sctp: fix a problem with net_namespace David Miller

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=1392169484-8256-2-git-send-email-wangweidong1@huawei.com \
    --to=wangweidong1@huawei.com \
    --cc=davem@davemloft.net \
    --cc=dborkman@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=vyasevich@gmail.com \
    /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.