diff options
author | Eric Dumazet <edumazet@google.com> | 2019-05-24 12:03:36 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-05-26 17:08:05 -0400 |
commit | d2dfd43598f3ce5441daabc7b352cdfea811e021 (patch) | |
tree | 03e768b4d81f54b5b1ce5628c54423602f0eafec /net | |
parent | 3bb13dd4cae022aab8bb7605bb5e3cc97e7523e0 (diff) |
ieee820154: 6lowpan: no longer reference init_net in lowpan_frags_ns_ctl_table
(struct net *)->ieee802154_lowpan.fqdir will soon be a pointer, so make
sure lowpan_frags_ns_ctl_table[] does not reference init_net.
lowpan_frags_ns_sysctl_register() can perform the needed initialization
for all netns.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ieee802154/6lowpan/reassembly.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/net/ieee802154/6lowpan/reassembly.c b/net/ieee802154/6lowpan/reassembly.c index 955047fe797a..4bbd6999c58f 100644 --- a/net/ieee802154/6lowpan/reassembly.c +++ b/net/ieee802154/6lowpan/reassembly.c | |||
@@ -326,23 +326,18 @@ err: | |||
326 | static struct ctl_table lowpan_frags_ns_ctl_table[] = { | 326 | static struct ctl_table lowpan_frags_ns_ctl_table[] = { |
327 | { | 327 | { |
328 | .procname = "6lowpanfrag_high_thresh", | 328 | .procname = "6lowpanfrag_high_thresh", |
329 | .data = &init_net.ieee802154_lowpan.fqdir.high_thresh, | ||
330 | .maxlen = sizeof(unsigned long), | 329 | .maxlen = sizeof(unsigned long), |
331 | .mode = 0644, | 330 | .mode = 0644, |
332 | .proc_handler = proc_doulongvec_minmax, | 331 | .proc_handler = proc_doulongvec_minmax, |
333 | .extra1 = &init_net.ieee802154_lowpan.fqdir.low_thresh | ||
334 | }, | 332 | }, |
335 | { | 333 | { |
336 | .procname = "6lowpanfrag_low_thresh", | 334 | .procname = "6lowpanfrag_low_thresh", |
337 | .data = &init_net.ieee802154_lowpan.fqdir.low_thresh, | ||
338 | .maxlen = sizeof(unsigned long), | 335 | .maxlen = sizeof(unsigned long), |
339 | .mode = 0644, | 336 | .mode = 0644, |
340 | .proc_handler = proc_doulongvec_minmax, | 337 | .proc_handler = proc_doulongvec_minmax, |
341 | .extra2 = &init_net.ieee802154_lowpan.fqdir.high_thresh | ||
342 | }, | 338 | }, |
343 | { | 339 | { |
344 | .procname = "6lowpanfrag_time", | 340 | .procname = "6lowpanfrag_time", |
345 | .data = &init_net.ieee802154_lowpan.fqdir.timeout, | ||
346 | .maxlen = sizeof(int), | 341 | .maxlen = sizeof(int), |
347 | .mode = 0644, | 342 | .mode = 0644, |
348 | .proc_handler = proc_dointvec_jiffies, | 343 | .proc_handler = proc_dointvec_jiffies, |
@@ -377,17 +372,17 @@ static int __net_init lowpan_frags_ns_sysctl_register(struct net *net) | |||
377 | if (table == NULL) | 372 | if (table == NULL) |
378 | goto err_alloc; | 373 | goto err_alloc; |
379 | 374 | ||
380 | table[0].data = &ieee802154_lowpan->fqdir.high_thresh; | ||
381 | table[0].extra1 = &ieee802154_lowpan->fqdir.low_thresh; | ||
382 | table[1].data = &ieee802154_lowpan->fqdir.low_thresh; | ||
383 | table[1].extra2 = &ieee802154_lowpan->fqdir.high_thresh; | ||
384 | table[2].data = &ieee802154_lowpan->fqdir.timeout; | ||
385 | |||
386 | /* Don't export sysctls to unprivileged users */ | 375 | /* Don't export sysctls to unprivileged users */ |
387 | if (net->user_ns != &init_user_ns) | 376 | if (net->user_ns != &init_user_ns) |
388 | table[0].procname = NULL; | 377 | table[0].procname = NULL; |
389 | } | 378 | } |
390 | 379 | ||
380 | table[0].data = &ieee802154_lowpan->fqdir.high_thresh; | ||
381 | table[0].extra1 = &ieee802154_lowpan->fqdir.low_thresh; | ||
382 | table[1].data = &ieee802154_lowpan->fqdir.low_thresh; | ||
383 | table[1].extra2 = &ieee802154_lowpan->fqdir.high_thresh; | ||
384 | table[2].data = &ieee802154_lowpan->fqdir.timeout; | ||
385 | |||
391 | hdr = register_net_sysctl(net, "net/ieee802154/6lowpan", table); | 386 | hdr = register_net_sysctl(net, "net/ieee802154/6lowpan", table); |
392 | if (hdr == NULL) | 387 | if (hdr == NULL) |
393 | goto err_reg; | 388 | goto err_reg; |