Skip to content

Commit

Permalink
sctp: fix a missed .data initialization
Browse files Browse the repository at this point in the history
As commit 3c68198("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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
wangweidong authored and David S. Miller committed Feb 13, 2014
1 parent 0e0eee2 commit 22a1f51
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/sctp/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 22a1f51

Please sign in to comment.