sysctl.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /* SCTP kernel implementation
  3. * (C) Copyright IBM Corp. 2002, 2004
  4. * Copyright (c) 2002 Intel Corp.
  5. *
  6. * This file is part of the SCTP kernel implementation
  7. *
  8. * Sysctl related interfaces for SCTP.
  9. *
  10. * Please send any bug reports or fixes you make to the
  11. * email address(es):
  12. * lksctp developers <[email protected]>
  13. *
  14. * Written or modified by:
  15. * Mingqin Liu <[email protected]>
  16. * Jon Grimm <[email protected]>
  17. * Ardelle Fan <[email protected]>
  18. * Ryan Layer <[email protected]>
  19. * Sridhar Samudrala <[email protected]>
  20. */
  21. #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  22. #include <net/sctp/structs.h>
  23. #include <net/sctp/sctp.h>
  24. #include <linux/sysctl.h>
  25. static int timer_max = 86400000; /* ms in one day */
  26. static int sack_timer_min = 1;
  27. static int sack_timer_max = 500;
  28. static int addr_scope_max = SCTP_SCOPE_POLICY_MAX;
  29. static int rwnd_scale_max = 16;
  30. static int rto_alpha_min = 0;
  31. static int rto_beta_min = 0;
  32. static int rto_alpha_max = 1000;
  33. static int rto_beta_max = 1000;
  34. static int pf_expose_max = SCTP_PF_EXPOSE_MAX;
  35. static int ps_retrans_max = SCTP_PS_RETRANS_MAX;
  36. static int udp_port_max = 65535;
  37. static unsigned long max_autoclose_min = 0;
  38. static unsigned long max_autoclose_max =
  39. (MAX_SCHEDULE_TIMEOUT / HZ > UINT_MAX)
  40. ? UINT_MAX : MAX_SCHEDULE_TIMEOUT / HZ;
  41. static int proc_sctp_do_hmac_alg(struct ctl_table *ctl, int write,
  42. void *buffer, size_t *lenp, loff_t *ppos);
  43. static int proc_sctp_do_rto_min(struct ctl_table *ctl, int write,
  44. void *buffer, size_t *lenp, loff_t *ppos);
  45. static int proc_sctp_do_rto_max(struct ctl_table *ctl, int write, void *buffer,
  46. size_t *lenp, loff_t *ppos);
  47. static int proc_sctp_do_udp_port(struct ctl_table *ctl, int write, void *buffer,
  48. size_t *lenp, loff_t *ppos);
  49. static int proc_sctp_do_alpha_beta(struct ctl_table *ctl, int write,
  50. void *buffer, size_t *lenp, loff_t *ppos);
  51. static int proc_sctp_do_auth(struct ctl_table *ctl, int write,
  52. void *buffer, size_t *lenp, loff_t *ppos);
  53. static int proc_sctp_do_probe_interval(struct ctl_table *ctl, int write,
  54. void *buffer, size_t *lenp, loff_t *ppos);
  55. static struct ctl_table sctp_table[] = {
  56. {
  57. .procname = "sctp_mem",
  58. .data = &sysctl_sctp_mem,
  59. .maxlen = sizeof(sysctl_sctp_mem),
  60. .mode = 0644,
  61. .proc_handler = proc_doulongvec_minmax
  62. },
  63. {
  64. .procname = "sctp_rmem",
  65. .data = &sysctl_sctp_rmem,
  66. .maxlen = sizeof(sysctl_sctp_rmem),
  67. .mode = 0644,
  68. .proc_handler = proc_dointvec,
  69. },
  70. {
  71. .procname = "sctp_wmem",
  72. .data = &sysctl_sctp_wmem,
  73. .maxlen = sizeof(sysctl_sctp_wmem),
  74. .mode = 0644,
  75. .proc_handler = proc_dointvec,
  76. },
  77. { /* sentinel */ }
  78. };
  79. /* The following index defines are used in sctp_sysctl_net_register().
  80. * If you add new items to the sctp_net_table, please ensure that
  81. * the index values of these defines hold the same meaning indicated by
  82. * their macro names when they appear in sctp_net_table.
  83. */
  84. #define SCTP_RTO_MIN_IDX 0
  85. #define SCTP_RTO_MAX_IDX 1
  86. #define SCTP_PF_RETRANS_IDX 2
  87. #define SCTP_PS_RETRANS_IDX 3
  88. static struct ctl_table sctp_net_table[] = {
  89. [SCTP_RTO_MIN_IDX] = {
  90. .procname = "rto_min",
  91. .data = &init_net.sctp.rto_min,
  92. .maxlen = sizeof(unsigned int),
  93. .mode = 0644,
  94. .proc_handler = proc_sctp_do_rto_min,
  95. .extra1 = SYSCTL_ONE,
  96. .extra2 = &init_net.sctp.rto_max
  97. },
  98. [SCTP_RTO_MAX_IDX] = {
  99. .procname = "rto_max",
  100. .data = &init_net.sctp.rto_max,
  101. .maxlen = sizeof(unsigned int),
  102. .mode = 0644,
  103. .proc_handler = proc_sctp_do_rto_max,
  104. .extra1 = &init_net.sctp.rto_min,
  105. .extra2 = &timer_max
  106. },
  107. [SCTP_PF_RETRANS_IDX] = {
  108. .procname = "pf_retrans",
  109. .data = &init_net.sctp.pf_retrans,
  110. .maxlen = sizeof(int),
  111. .mode = 0644,
  112. .proc_handler = proc_dointvec_minmax,
  113. .extra1 = SYSCTL_ZERO,
  114. .extra2 = &init_net.sctp.ps_retrans,
  115. },
  116. [SCTP_PS_RETRANS_IDX] = {
  117. .procname = "ps_retrans",
  118. .data = &init_net.sctp.ps_retrans,
  119. .maxlen = sizeof(int),
  120. .mode = 0644,
  121. .proc_handler = proc_dointvec_minmax,
  122. .extra1 = &init_net.sctp.pf_retrans,
  123. .extra2 = &ps_retrans_max,
  124. },
  125. {
  126. .procname = "rto_initial",
  127. .data = &init_net.sctp.rto_initial,
  128. .maxlen = sizeof(unsigned int),
  129. .mode = 0644,
  130. .proc_handler = proc_dointvec_minmax,
  131. .extra1 = SYSCTL_ONE,
  132. .extra2 = &timer_max
  133. },
  134. {
  135. .procname = "rto_alpha_exp_divisor",
  136. .data = &init_net.sctp.rto_alpha,
  137. .maxlen = sizeof(int),
  138. .mode = 0644,
  139. .proc_handler = proc_sctp_do_alpha_beta,
  140. .extra1 = &rto_alpha_min,
  141. .extra2 = &rto_alpha_max,
  142. },
  143. {
  144. .procname = "rto_beta_exp_divisor",
  145. .data = &init_net.sctp.rto_beta,
  146. .maxlen = sizeof(int),
  147. .mode = 0644,
  148. .proc_handler = proc_sctp_do_alpha_beta,
  149. .extra1 = &rto_beta_min,
  150. .extra2 = &rto_beta_max,
  151. },
  152. {
  153. .procname = "max_burst",
  154. .data = &init_net.sctp.max_burst,
  155. .maxlen = sizeof(int),
  156. .mode = 0644,
  157. .proc_handler = proc_dointvec_minmax,
  158. .extra1 = SYSCTL_ZERO,
  159. .extra2 = SYSCTL_INT_MAX,
  160. },
  161. {
  162. .procname = "cookie_preserve_enable",
  163. .data = &init_net.sctp.cookie_preserve_enable,
  164. .maxlen = sizeof(int),
  165. .mode = 0644,
  166. .proc_handler = proc_dointvec,
  167. },
  168. {
  169. .procname = "cookie_hmac_alg",
  170. .data = &init_net.sctp.sctp_hmac_alg,
  171. .maxlen = 8,
  172. .mode = 0644,
  173. .proc_handler = proc_sctp_do_hmac_alg,
  174. },
  175. {
  176. .procname = "valid_cookie_life",
  177. .data = &init_net.sctp.valid_cookie_life,
  178. .maxlen = sizeof(unsigned int),
  179. .mode = 0644,
  180. .proc_handler = proc_dointvec_minmax,
  181. .extra1 = SYSCTL_ONE,
  182. .extra2 = &timer_max
  183. },
  184. {
  185. .procname = "sack_timeout",
  186. .data = &init_net.sctp.sack_timeout,
  187. .maxlen = sizeof(int),
  188. .mode = 0644,
  189. .proc_handler = proc_dointvec_minmax,
  190. .extra1 = &sack_timer_min,
  191. .extra2 = &sack_timer_max,
  192. },
  193. {
  194. .procname = "hb_interval",
  195. .data = &init_net.sctp.hb_interval,
  196. .maxlen = sizeof(unsigned int),
  197. .mode = 0644,
  198. .proc_handler = proc_dointvec_minmax,
  199. .extra1 = SYSCTL_ONE,
  200. .extra2 = &timer_max
  201. },
  202. {
  203. .procname = "association_max_retrans",
  204. .data = &init_net.sctp.max_retrans_association,
  205. .maxlen = sizeof(int),
  206. .mode = 0644,
  207. .proc_handler = proc_dointvec_minmax,
  208. .extra1 = SYSCTL_ONE,
  209. .extra2 = SYSCTL_INT_MAX,
  210. },
  211. {
  212. .procname = "path_max_retrans",
  213. .data = &init_net.sctp.max_retrans_path,
  214. .maxlen = sizeof(int),
  215. .mode = 0644,
  216. .proc_handler = proc_dointvec_minmax,
  217. .extra1 = SYSCTL_ONE,
  218. .extra2 = SYSCTL_INT_MAX,
  219. },
  220. {
  221. .procname = "max_init_retransmits",
  222. .data = &init_net.sctp.max_retrans_init,
  223. .maxlen = sizeof(int),
  224. .mode = 0644,
  225. .proc_handler = proc_dointvec_minmax,
  226. .extra1 = SYSCTL_ONE,
  227. .extra2 = SYSCTL_INT_MAX,
  228. },
  229. {
  230. .procname = "sndbuf_policy",
  231. .data = &init_net.sctp.sndbuf_policy,
  232. .maxlen = sizeof(int),
  233. .mode = 0644,
  234. .proc_handler = proc_dointvec,
  235. },
  236. {
  237. .procname = "rcvbuf_policy",
  238. .data = &init_net.sctp.rcvbuf_policy,
  239. .maxlen = sizeof(int),
  240. .mode = 0644,
  241. .proc_handler = proc_dointvec,
  242. },
  243. {
  244. .procname = "default_auto_asconf",
  245. .data = &init_net.sctp.default_auto_asconf,
  246. .maxlen = sizeof(int),
  247. .mode = 0644,
  248. .proc_handler = proc_dointvec,
  249. },
  250. {
  251. .procname = "addip_enable",
  252. .data = &init_net.sctp.addip_enable,
  253. .maxlen = sizeof(int),
  254. .mode = 0644,
  255. .proc_handler = proc_dointvec,
  256. },
  257. {
  258. .procname = "addip_noauth_enable",
  259. .data = &init_net.sctp.addip_noauth,
  260. .maxlen = sizeof(int),
  261. .mode = 0644,
  262. .proc_handler = proc_dointvec,
  263. },
  264. {
  265. .procname = "prsctp_enable",
  266. .data = &init_net.sctp.prsctp_enable,
  267. .maxlen = sizeof(int),
  268. .mode = 0644,
  269. .proc_handler = proc_dointvec,
  270. },
  271. {
  272. .procname = "reconf_enable",
  273. .data = &init_net.sctp.reconf_enable,
  274. .maxlen = sizeof(int),
  275. .mode = 0644,
  276. .proc_handler = proc_dointvec,
  277. },
  278. {
  279. .procname = "auth_enable",
  280. .data = &init_net.sctp.auth_enable,
  281. .maxlen = sizeof(int),
  282. .mode = 0644,
  283. .proc_handler = proc_sctp_do_auth,
  284. },
  285. {
  286. .procname = "intl_enable",
  287. .data = &init_net.sctp.intl_enable,
  288. .maxlen = sizeof(int),
  289. .mode = 0644,
  290. .proc_handler = proc_dointvec,
  291. },
  292. {
  293. .procname = "ecn_enable",
  294. .data = &init_net.sctp.ecn_enable,
  295. .maxlen = sizeof(int),
  296. .mode = 0644,
  297. .proc_handler = proc_dointvec,
  298. },
  299. {
  300. .procname = "plpmtud_probe_interval",
  301. .data = &init_net.sctp.probe_interval,
  302. .maxlen = sizeof(int),
  303. .mode = 0644,
  304. .proc_handler = proc_sctp_do_probe_interval,
  305. },
  306. {
  307. .procname = "udp_port",
  308. .data = &init_net.sctp.udp_port,
  309. .maxlen = sizeof(int),
  310. .mode = 0644,
  311. .proc_handler = proc_sctp_do_udp_port,
  312. .extra1 = SYSCTL_ZERO,
  313. .extra2 = &udp_port_max,
  314. },
  315. {
  316. .procname = "encap_port",
  317. .data = &init_net.sctp.encap_port,
  318. .maxlen = sizeof(int),
  319. .mode = 0644,
  320. .proc_handler = proc_dointvec_minmax,
  321. .extra1 = SYSCTL_ZERO,
  322. .extra2 = &udp_port_max,
  323. },
  324. {
  325. .procname = "addr_scope_policy",
  326. .data = &init_net.sctp.scope_policy,
  327. .maxlen = sizeof(int),
  328. .mode = 0644,
  329. .proc_handler = proc_dointvec_minmax,
  330. .extra1 = SYSCTL_ZERO,
  331. .extra2 = &addr_scope_max,
  332. },
  333. {
  334. .procname = "rwnd_update_shift",
  335. .data = &init_net.sctp.rwnd_upd_shift,
  336. .maxlen = sizeof(int),
  337. .mode = 0644,
  338. .proc_handler = &proc_dointvec_minmax,
  339. .extra1 = SYSCTL_ONE,
  340. .extra2 = &rwnd_scale_max,
  341. },
  342. {
  343. .procname = "max_autoclose",
  344. .data = &init_net.sctp.max_autoclose,
  345. .maxlen = sizeof(unsigned long),
  346. .mode = 0644,
  347. .proc_handler = &proc_doulongvec_minmax,
  348. .extra1 = &max_autoclose_min,
  349. .extra2 = &max_autoclose_max,
  350. },
  351. {
  352. .procname = "pf_enable",
  353. .data = &init_net.sctp.pf_enable,
  354. .maxlen = sizeof(int),
  355. .mode = 0644,
  356. .proc_handler = proc_dointvec,
  357. },
  358. {
  359. .procname = "pf_expose",
  360. .data = &init_net.sctp.pf_expose,
  361. .maxlen = sizeof(int),
  362. .mode = 0644,
  363. .proc_handler = proc_dointvec_minmax,
  364. .extra1 = SYSCTL_ZERO,
  365. .extra2 = &pf_expose_max,
  366. },
  367. { /* sentinel */ }
  368. };
  369. static int proc_sctp_do_hmac_alg(struct ctl_table *ctl, int write,
  370. void *buffer, size_t *lenp, loff_t *ppos)
  371. {
  372. struct net *net = current->nsproxy->net_ns;
  373. struct ctl_table tbl;
  374. bool changed = false;
  375. char *none = "none";
  376. char tmp[8] = {0};
  377. int ret;
  378. memset(&tbl, 0, sizeof(struct ctl_table));
  379. if (write) {
  380. tbl.data = tmp;
  381. tbl.maxlen = sizeof(tmp);
  382. } else {
  383. tbl.data = net->sctp.sctp_hmac_alg ? : none;
  384. tbl.maxlen = strlen(tbl.data);
  385. }
  386. ret = proc_dostring(&tbl, write, buffer, lenp, ppos);
  387. if (write && ret == 0) {
  388. #ifdef CONFIG_CRYPTO_MD5
  389. if (!strncmp(tmp, "md5", 3)) {
  390. net->sctp.sctp_hmac_alg = "md5";
  391. changed = true;
  392. }
  393. #endif
  394. #ifdef CONFIG_CRYPTO_SHA1
  395. if (!strncmp(tmp, "sha1", 4)) {
  396. net->sctp.sctp_hmac_alg = "sha1";
  397. changed = true;
  398. }
  399. #endif
  400. if (!strncmp(tmp, "none", 4)) {
  401. net->sctp.sctp_hmac_alg = NULL;
  402. changed = true;
  403. }
  404. if (!changed)
  405. ret = -EINVAL;
  406. }
  407. return ret;
  408. }
  409. static int proc_sctp_do_rto_min(struct ctl_table *ctl, int write,
  410. void *buffer, size_t *lenp, loff_t *ppos)
  411. {
  412. struct net *net = current->nsproxy->net_ns;
  413. unsigned int min = *(unsigned int *) ctl->extra1;
  414. unsigned int max = *(unsigned int *) ctl->extra2;
  415. struct ctl_table tbl;
  416. int ret, new_value;
  417. memset(&tbl, 0, sizeof(struct ctl_table));
  418. tbl.maxlen = sizeof(unsigned int);
  419. if (write)
  420. tbl.data = &new_value;
  421. else
  422. tbl.data = &net->sctp.rto_min;
  423. ret = proc_dointvec(&tbl, write, buffer, lenp, ppos);
  424. if (write && ret == 0) {
  425. if (new_value > max || new_value < min)
  426. return -EINVAL;
  427. net->sctp.rto_min = new_value;
  428. }
  429. return ret;
  430. }
  431. static int proc_sctp_do_rto_max(struct ctl_table *ctl, int write,
  432. void *buffer, size_t *lenp, loff_t *ppos)
  433. {
  434. struct net *net = current->nsproxy->net_ns;
  435. unsigned int min = *(unsigned int *) ctl->extra1;
  436. unsigned int max = *(unsigned int *) ctl->extra2;
  437. struct ctl_table tbl;
  438. int ret, new_value;
  439. memset(&tbl, 0, sizeof(struct ctl_table));
  440. tbl.maxlen = sizeof(unsigned int);
  441. if (write)
  442. tbl.data = &new_value;
  443. else
  444. tbl.data = &net->sctp.rto_max;
  445. ret = proc_dointvec(&tbl, write, buffer, lenp, ppos);
  446. if (write && ret == 0) {
  447. if (new_value > max || new_value < min)
  448. return -EINVAL;
  449. net->sctp.rto_max = new_value;
  450. }
  451. return ret;
  452. }
  453. static int proc_sctp_do_alpha_beta(struct ctl_table *ctl, int write,
  454. void *buffer, size_t *lenp, loff_t *ppos)
  455. {
  456. if (write)
  457. pr_warn_once("Changing rto_alpha or rto_beta may lead to "
  458. "suboptimal rtt/srtt estimations!\n");
  459. return proc_dointvec_minmax(ctl, write, buffer, lenp, ppos);
  460. }
  461. static int proc_sctp_do_auth(struct ctl_table *ctl, int write,
  462. void *buffer, size_t *lenp, loff_t *ppos)
  463. {
  464. struct net *net = current->nsproxy->net_ns;
  465. struct ctl_table tbl;
  466. int new_value, ret;
  467. memset(&tbl, 0, sizeof(struct ctl_table));
  468. tbl.maxlen = sizeof(unsigned int);
  469. if (write)
  470. tbl.data = &new_value;
  471. else
  472. tbl.data = &net->sctp.auth_enable;
  473. ret = proc_dointvec(&tbl, write, buffer, lenp, ppos);
  474. if (write && ret == 0) {
  475. struct sock *sk = net->sctp.ctl_sock;
  476. net->sctp.auth_enable = new_value;
  477. /* Update the value in the control socket */
  478. lock_sock(sk);
  479. sctp_sk(sk)->ep->auth_enable = new_value;
  480. release_sock(sk);
  481. }
  482. return ret;
  483. }
  484. static int proc_sctp_do_udp_port(struct ctl_table *ctl, int write,
  485. void *buffer, size_t *lenp, loff_t *ppos)
  486. {
  487. struct net *net = current->nsproxy->net_ns;
  488. unsigned int min = *(unsigned int *)ctl->extra1;
  489. unsigned int max = *(unsigned int *)ctl->extra2;
  490. struct ctl_table tbl;
  491. int ret, new_value;
  492. memset(&tbl, 0, sizeof(struct ctl_table));
  493. tbl.maxlen = sizeof(unsigned int);
  494. if (write)
  495. tbl.data = &new_value;
  496. else
  497. tbl.data = &net->sctp.udp_port;
  498. ret = proc_dointvec(&tbl, write, buffer, lenp, ppos);
  499. if (write && ret == 0) {
  500. struct sock *sk = net->sctp.ctl_sock;
  501. if (new_value > max || new_value < min)
  502. return -EINVAL;
  503. net->sctp.udp_port = new_value;
  504. sctp_udp_sock_stop(net);
  505. if (new_value) {
  506. ret = sctp_udp_sock_start(net);
  507. if (ret)
  508. net->sctp.udp_port = 0;
  509. }
  510. /* Update the value in the control socket */
  511. lock_sock(sk);
  512. sctp_sk(sk)->udp_port = htons(net->sctp.udp_port);
  513. release_sock(sk);
  514. }
  515. return ret;
  516. }
  517. static int proc_sctp_do_probe_interval(struct ctl_table *ctl, int write,
  518. void *buffer, size_t *lenp, loff_t *ppos)
  519. {
  520. struct net *net = current->nsproxy->net_ns;
  521. struct ctl_table tbl;
  522. int ret, new_value;
  523. memset(&tbl, 0, sizeof(struct ctl_table));
  524. tbl.maxlen = sizeof(unsigned int);
  525. if (write)
  526. tbl.data = &new_value;
  527. else
  528. tbl.data = &net->sctp.probe_interval;
  529. ret = proc_dointvec(&tbl, write, buffer, lenp, ppos);
  530. if (write && ret == 0) {
  531. if (new_value && new_value < SCTP_PROBE_TIMER_MIN)
  532. return -EINVAL;
  533. net->sctp.probe_interval = new_value;
  534. }
  535. return ret;
  536. }
  537. int sctp_sysctl_net_register(struct net *net)
  538. {
  539. struct ctl_table *table;
  540. int i;
  541. table = kmemdup(sctp_net_table, sizeof(sctp_net_table), GFP_KERNEL);
  542. if (!table)
  543. return -ENOMEM;
  544. for (i = 0; table[i].data; i++)
  545. table[i].data += (char *)(&net->sctp) - (char *)&init_net.sctp;
  546. table[SCTP_RTO_MIN_IDX].extra2 = &net->sctp.rto_max;
  547. table[SCTP_RTO_MAX_IDX].extra1 = &net->sctp.rto_min;
  548. table[SCTP_PF_RETRANS_IDX].extra2 = &net->sctp.ps_retrans;
  549. table[SCTP_PS_RETRANS_IDX].extra1 = &net->sctp.pf_retrans;
  550. net->sctp.sysctl_header = register_net_sysctl(net, "net/sctp", table);
  551. if (net->sctp.sysctl_header == NULL) {
  552. kfree(table);
  553. return -ENOMEM;
  554. }
  555. return 0;
  556. }
  557. void sctp_sysctl_net_unregister(struct net *net)
  558. {
  559. struct ctl_table *table;
  560. table = net->sctp.sysctl_header->ctl_table_arg;
  561. unregister_net_sysctl_table(net->sctp.sysctl_header);
  562. kfree(table);
  563. }
  564. static struct ctl_table_header *sctp_sysctl_header;
  565. /* Sysctl registration. */
  566. void sctp_sysctl_register(void)
  567. {
  568. sctp_sysctl_header = register_net_sysctl(&init_net, "net/sctp", sctp_table);
  569. }
  570. /* Sysctl deregistration. */
  571. void sctp_sysctl_unregister(void)
  572. {
  573. unregister_net_sysctl_table(sctp_sysctl_header);
  574. }