diff options
Diffstat (limited to 'net/sctp/sysctl.c')
-rw-r--r-- | net/sctp/sysctl.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c index b0565afb61c7..35c8923b5554 100644 --- a/net/sctp/sysctl.c +++ b/net/sctp/sysctl.c | |||
@@ -19,9 +19,8 @@ | |||
19 | * See the GNU General Public License for more details. | 19 | * See the GNU General Public License for more details. |
20 | * | 20 | * |
21 | * You should have received a copy of the GNU General Public License | 21 | * You should have received a copy of the GNU General Public License |
22 | * along with GNU CC; see the file COPYING. If not, write to | 22 | * along with GNU CC; see the file COPYING. If not, see |
23 | * the Free Software Foundation, 59 Temple Place - Suite 330, | 23 | * <http://www.gnu.org/licenses/>. |
24 | * Boston, MA 02111-1307, USA. | ||
25 | * | 24 | * |
26 | * Please send any bug reports or fixes you make to the | 25 | * Please send any bug reports or fixes you make to the |
27 | * email address(es): | 26 | * email address(es): |
@@ -152,6 +151,7 @@ static struct ctl_table sctp_net_table[] = { | |||
152 | }, | 151 | }, |
153 | { | 152 | { |
154 | .procname = "cookie_hmac_alg", | 153 | .procname = "cookie_hmac_alg", |
154 | .data = &init_net.sctp.sctp_hmac_alg, | ||
155 | .maxlen = 8, | 155 | .maxlen = 8, |
156 | .mode = 0644, | 156 | .mode = 0644, |
157 | .proc_handler = proc_sctp_do_hmac_alg, | 157 | .proc_handler = proc_sctp_do_hmac_alg, |
@@ -402,15 +402,18 @@ static int proc_sctp_do_rto_max(struct ctl_table *ctl, int write, | |||
402 | 402 | ||
403 | int sctp_sysctl_net_register(struct net *net) | 403 | int sctp_sysctl_net_register(struct net *net) |
404 | { | 404 | { |
405 | struct ctl_table *table; | 405 | struct ctl_table *table = sctp_net_table; |
406 | int i; | 406 | |
407 | if (!net_eq(net, &init_net)) { | ||
408 | int i; | ||
407 | 409 | ||
408 | table = kmemdup(sctp_net_table, sizeof(sctp_net_table), GFP_KERNEL); | 410 | table = kmemdup(sctp_net_table, sizeof(sctp_net_table), GFP_KERNEL); |
409 | if (!table) | 411 | if (!table) |
410 | return -ENOMEM; | 412 | return -ENOMEM; |
411 | 413 | ||
412 | for (i = 0; table[i].data; i++) | 414 | for (i = 0; table[i].data; i++) |
413 | table[i].data += (char *)(&net->sctp) - (char *)&init_net.sctp; | 415 | table[i].data += (char *)(&net->sctp) - (char *)&init_net.sctp; |
416 | } | ||
414 | 417 | ||
415 | net->sctp.sysctl_header = register_net_sysctl(net, "net/sctp", table); | 418 | net->sctp.sysctl_header = register_net_sysctl(net, "net/sctp", table); |
416 | return 0; | 419 | return 0; |
@@ -425,7 +428,7 @@ void sctp_sysctl_net_unregister(struct net *net) | |||
425 | kfree(table); | 428 | kfree(table); |
426 | } | 429 | } |
427 | 430 | ||
428 | static struct ctl_table_header * sctp_sysctl_header; | 431 | static struct ctl_table_header *sctp_sysctl_header; |
429 | 432 | ||
430 | /* Sysctl registration. */ | 433 | /* Sysctl registration. */ |
431 | void sctp_sysctl_register(void) | 434 | void sctp_sysctl_register(void) |