diff options
author | Mark Brown <broonie@linaro.org> | 2014-03-19 13:02:34 +0000 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-03-19 13:02:34 +0000 |
commit | 236b11de51c7501c454ca125d84152b06ef7f27e (patch) | |
tree | d0ca0b99961da2a8a46b4f86a57de8424dadce1d /net/sctp/sysctl.c | |
parent | 0f4cc282951a76011db1da6787b3d2acc63238ca (diff) | |
parent | ba3e31f87e8b736adf01f1dc09cd5618966ee193 (diff) | |
download | linux-236b11de51c7501c454ca125d84152b06ef7f27e.tar.gz linux-236b11de51c7501c454ca125d84152b06ef7f27e.tar.xz |
Merge branch 'ib-mfd-regulator-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into regulator-s2mps11
Diffstat (limited to 'net/sctp/sysctl.c')
-rw-r--r-- | net/sctp/sysctl.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c index 7135e617ab0f..35c8923b5554 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, @@ -401,15 +402,18 @@ static int proc_sctp_do_rto_max(struct ctl_table *ctl, int write, int sctp_sysctl_net_register(struct net *net) { - struct ctl_table *table; - int i; + struct ctl_table *table = sctp_net_table; + + if (!net_eq(net, &init_net)) { + int i; - table = kmemdup(sctp_net_table, sizeof(sctp_net_table), GFP_KERNEL); - if (!table) - return -ENOMEM; + table = kmemdup(sctp_net_table, sizeof(sctp_net_table), GFP_KERNEL); + if (!table) + return -ENOMEM; - for (i = 0; table[i].data; i++) - table[i].data += (char *)(&net->sctp) - (char *)&init_net.sctp; + for (i = 0; table[i].data; i++) + table[i].data += (char *)(&net->sctp) - (char *)&init_net.sctp; + } net->sctp.sysctl_header = register_net_sysctl(net, "net/sctp", table); return 0; |