]>
Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * sysctl_net_ipv4.c: sysctl interface to net IPV4 subsystem. | |
3 | * | |
4 | * $Id: sysctl_net_ipv4.c,v 1.50 2001/10/20 00:00:11 davem Exp $ | |
5 | * | |
6 | * Begun April 1, 1996, Mike Shaver. | |
7 | * Added /proc/sys/net/ipv4 directory entry (empty =) ). [MS] | |
8 | */ | |
9 | ||
10 | #include <linux/mm.h> | |
11 | #include <linux/module.h> | |
12 | #include <linux/sysctl.h> | |
20380731 | 13 | #include <linux/igmp.h> |
14c85021 | 14 | #include <linux/inetdevice.h> |
227b60f5 | 15 | #include <linux/seqlock.h> |
1da177e4 | 16 | #include <net/snmp.h> |
20380731 | 17 | #include <net/icmp.h> |
1da177e4 LT |
18 | #include <net/ip.h> |
19 | #include <net/route.h> | |
20 | #include <net/tcp.h> | |
446fda4f | 21 | #include <net/cipso_ipv4.h> |
04128f23 | 22 | #include <net/inet_frag.h> |
1da177e4 | 23 | |
89cee8b1 | 24 | static int zero; |
e905a9ed | 25 | static int tcp_retr1_max = 255; |
1da177e4 LT |
26 | static int ip_local_port_range_min[] = { 1, 1 }; |
27 | static int ip_local_port_range_max[] = { 65535, 65535 }; | |
1da177e4 LT |
28 | |
29 | static | |
30 | int ipv4_sysctl_forward(ctl_table *ctl, int write, struct file * filp, | |
31 | void __user *buffer, size_t *lenp, loff_t *ppos) | |
32 | { | |
42f811b8 | 33 | int val = IPV4_DEVCONF_ALL(FORWARDING); |
1da177e4 LT |
34 | int ret; |
35 | ||
36 | ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos); | |
37 | ||
42f811b8 | 38 | if (write && IPV4_DEVCONF_ALL(FORWARDING) != val) |
1da177e4 LT |
39 | inet_forward_change(); |
40 | ||
41 | return ret; | |
42 | } | |
43 | ||
44 | static int ipv4_sysctl_forward_strategy(ctl_table *table, | |
45 | int __user *name, int nlen, | |
46 | void __user *oldval, size_t __user *oldlenp, | |
1f29bcd7 | 47 | void __user *newval, size_t newlen) |
1da177e4 LT |
48 | { |
49 | int *valp = table->data; | |
50 | int new; | |
51 | ||
52 | if (!newval || !newlen) | |
53 | return 0; | |
54 | ||
55 | if (newlen != sizeof(int)) | |
56 | return -EINVAL; | |
57 | ||
58 | if (get_user(new, (int __user *)newval)) | |
59 | return -EFAULT; | |
60 | ||
61 | if (new == *valp) | |
62 | return 0; | |
63 | ||
64 | if (oldval && oldlenp) { | |
65 | size_t len; | |
66 | ||
67 | if (get_user(len, oldlenp)) | |
68 | return -EFAULT; | |
69 | ||
70 | if (len) { | |
71 | if (len > table->maxlen) | |
72 | len = table->maxlen; | |
73 | if (copy_to_user(oldval, valp, len)) | |
74 | return -EFAULT; | |
75 | if (put_user(len, oldlenp)) | |
76 | return -EFAULT; | |
77 | } | |
78 | } | |
79 | ||
80 | *valp = new; | |
81 | inet_forward_change(); | |
82 | return 1; | |
83 | } | |
84 | ||
227b60f5 SH |
85 | extern seqlock_t sysctl_port_range_lock; |
86 | extern int sysctl_local_port_range[2]; | |
87 | ||
88 | /* Update system visible IP port range */ | |
89 | static void set_local_port_range(int range[2]) | |
90 | { | |
91 | write_seqlock(&sysctl_port_range_lock); | |
92 | sysctl_local_port_range[0] = range[0]; | |
93 | sysctl_local_port_range[1] = range[1]; | |
94 | write_sequnlock(&sysctl_port_range_lock); | |
95 | } | |
96 | ||
97 | /* Validate changes from /proc interface. */ | |
98 | static int ipv4_local_port_range(ctl_table *table, int write, struct file *filp, | |
99 | void __user *buffer, | |
100 | size_t *lenp, loff_t *ppos) | |
101 | { | |
102 | int ret; | |
103 | int range[2] = { sysctl_local_port_range[0], | |
104 | sysctl_local_port_range[1] }; | |
105 | ctl_table tmp = { | |
106 | .data = &range, | |
107 | .maxlen = sizeof(range), | |
108 | .mode = table->mode, | |
109 | .extra1 = &ip_local_port_range_min, | |
110 | .extra2 = &ip_local_port_range_max, | |
111 | }; | |
112 | ||
113 | ret = proc_dointvec_minmax(&tmp, write, filp, buffer, lenp, ppos); | |
114 | ||
115 | if (write && ret == 0) { | |
a25de534 | 116 | if (range[1] < range[0]) |
227b60f5 SH |
117 | ret = -EINVAL; |
118 | else | |
119 | set_local_port_range(range); | |
120 | } | |
121 | ||
122 | return ret; | |
123 | } | |
124 | ||
125 | /* Validate changes from sysctl interface. */ | |
126 | static int ipv4_sysctl_local_port_range(ctl_table *table, int __user *name, | |
127 | int nlen, void __user *oldval, | |
128 | size_t __user *oldlenp, | |
129 | void __user *newval, size_t newlen) | |
130 | { | |
131 | int ret; | |
132 | int range[2] = { sysctl_local_port_range[0], | |
133 | sysctl_local_port_range[1] }; | |
134 | ctl_table tmp = { | |
135 | .data = &range, | |
136 | .maxlen = sizeof(range), | |
137 | .mode = table->mode, | |
138 | .extra1 = &ip_local_port_range_min, | |
139 | .extra2 = &ip_local_port_range_max, | |
140 | }; | |
141 | ||
142 | ret = sysctl_intvec(&tmp, name, nlen, oldval, oldlenp, newval, newlen); | |
143 | if (ret == 0 && newval && newlen) { | |
a25de534 | 144 | if (range[1] < range[0]) |
227b60f5 SH |
145 | ret = -EINVAL; |
146 | else | |
147 | set_local_port_range(range); | |
148 | } | |
149 | return ret; | |
150 | } | |
151 | ||
152 | ||
317a76f9 SH |
153 | static int proc_tcp_congestion_control(ctl_table *ctl, int write, struct file * filp, |
154 | void __user *buffer, size_t *lenp, loff_t *ppos) | |
155 | { | |
156 | char val[TCP_CA_NAME_MAX]; | |
157 | ctl_table tbl = { | |
158 | .data = val, | |
159 | .maxlen = TCP_CA_NAME_MAX, | |
160 | }; | |
161 | int ret; | |
162 | ||
163 | tcp_get_default_congestion_control(val); | |
164 | ||
165 | ret = proc_dostring(&tbl, write, filp, buffer, lenp, ppos); | |
166 | if (write && ret == 0) | |
167 | ret = tcp_set_default_congestion_control(val); | |
168 | return ret; | |
169 | } | |
170 | ||
20380731 ACM |
171 | static int sysctl_tcp_congestion_control(ctl_table *table, int __user *name, |
172 | int nlen, void __user *oldval, | |
173 | size_t __user *oldlenp, | |
1f29bcd7 | 174 | void __user *newval, size_t newlen) |
317a76f9 SH |
175 | { |
176 | char val[TCP_CA_NAME_MAX]; | |
177 | ctl_table tbl = { | |
178 | .data = val, | |
179 | .maxlen = TCP_CA_NAME_MAX, | |
180 | }; | |
181 | int ret; | |
182 | ||
183 | tcp_get_default_congestion_control(val); | |
1f29bcd7 | 184 | ret = sysctl_string(&tbl, name, nlen, oldval, oldlenp, newval, newlen); |
5487796f | 185 | if (ret == 1 && newval && newlen) |
317a76f9 SH |
186 | ret = tcp_set_default_congestion_control(val); |
187 | return ret; | |
188 | } | |
189 | ||
3ff825b2 SH |
190 | static int proc_tcp_available_congestion_control(ctl_table *ctl, |
191 | int write, struct file * filp, | |
192 | void __user *buffer, size_t *lenp, | |
193 | loff_t *ppos) | |
194 | { | |
195 | ctl_table tbl = { .maxlen = TCP_CA_BUF_MAX, }; | |
196 | int ret; | |
197 | ||
198 | tbl.data = kmalloc(tbl.maxlen, GFP_USER); | |
199 | if (!tbl.data) | |
200 | return -ENOMEM; | |
201 | tcp_get_available_congestion_control(tbl.data, TCP_CA_BUF_MAX); | |
202 | ret = proc_dostring(&tbl, write, filp, buffer, lenp, ppos); | |
203 | kfree(tbl.data); | |
204 | return ret; | |
205 | } | |
206 | ||
ce7bc3bf SH |
207 | static int proc_allowed_congestion_control(ctl_table *ctl, |
208 | int write, struct file * filp, | |
209 | void __user *buffer, size_t *lenp, | |
210 | loff_t *ppos) | |
211 | { | |
212 | ctl_table tbl = { .maxlen = TCP_CA_BUF_MAX }; | |
213 | int ret; | |
214 | ||
215 | tbl.data = kmalloc(tbl.maxlen, GFP_USER); | |
216 | if (!tbl.data) | |
217 | return -ENOMEM; | |
218 | ||
219 | tcp_get_allowed_congestion_control(tbl.data, tbl.maxlen); | |
220 | ret = proc_dostring(&tbl, write, filp, buffer, lenp, ppos); | |
221 | if (write && ret == 0) | |
222 | ret = tcp_set_allowed_congestion_control(tbl.data); | |
223 | kfree(tbl.data); | |
224 | return ret; | |
225 | } | |
226 | ||
227 | static int strategy_allowed_congestion_control(ctl_table *table, int __user *name, | |
228 | int nlen, void __user *oldval, | |
229 | size_t __user *oldlenp, | |
1f29bcd7 AD |
230 | void __user *newval, |
231 | size_t newlen) | |
ce7bc3bf SH |
232 | { |
233 | ctl_table tbl = { .maxlen = TCP_CA_BUF_MAX }; | |
234 | int ret; | |
235 | ||
236 | tbl.data = kmalloc(tbl.maxlen, GFP_USER); | |
237 | if (!tbl.data) | |
238 | return -ENOMEM; | |
239 | ||
240 | tcp_get_available_congestion_control(tbl.data, tbl.maxlen); | |
1f29bcd7 | 241 | ret = sysctl_string(&tbl, name, nlen, oldval, oldlenp, newval, newlen); |
ce7bc3bf SH |
242 | if (ret == 0 && newval && newlen) |
243 | ret = tcp_set_allowed_congestion_control(tbl.data); | |
244 | kfree(tbl.data); | |
245 | ||
246 | return ret; | |
247 | ||
248 | } | |
249 | ||
1da177e4 | 250 | ctl_table ipv4_table[] = { |
e905a9ed | 251 | { |
1da177e4 LT |
252 | .ctl_name = NET_IPV4_TCP_TIMESTAMPS, |
253 | .procname = "tcp_timestamps", | |
254 | .data = &sysctl_tcp_timestamps, | |
255 | .maxlen = sizeof(int), | |
256 | .mode = 0644, | |
257 | .proc_handler = &proc_dointvec | |
258 | }, | |
e905a9ed | 259 | { |
1da177e4 LT |
260 | .ctl_name = NET_IPV4_TCP_WINDOW_SCALING, |
261 | .procname = "tcp_window_scaling", | |
262 | .data = &sysctl_tcp_window_scaling, | |
263 | .maxlen = sizeof(int), | |
264 | .mode = 0644, | |
265 | .proc_handler = &proc_dointvec | |
266 | }, | |
e905a9ed | 267 | { |
1da177e4 LT |
268 | .ctl_name = NET_IPV4_TCP_SACK, |
269 | .procname = "tcp_sack", | |
270 | .data = &sysctl_tcp_sack, | |
271 | .maxlen = sizeof(int), | |
272 | .mode = 0644, | |
273 | .proc_handler = &proc_dointvec | |
274 | }, | |
e905a9ed | 275 | { |
1da177e4 LT |
276 | .ctl_name = NET_IPV4_TCP_RETRANS_COLLAPSE, |
277 | .procname = "tcp_retrans_collapse", | |
278 | .data = &sysctl_tcp_retrans_collapse, | |
279 | .maxlen = sizeof(int), | |
280 | .mode = 0644, | |
281 | .proc_handler = &proc_dointvec | |
282 | }, | |
e905a9ed | 283 | { |
1da177e4 LT |
284 | .ctl_name = NET_IPV4_FORWARD, |
285 | .procname = "ip_forward", | |
42f811b8 | 286 | .data = &IPV4_DEVCONF_ALL(FORWARDING), |
1da177e4 LT |
287 | .maxlen = sizeof(int), |
288 | .mode = 0644, | |
289 | .proc_handler = &ipv4_sysctl_forward, | |
290 | .strategy = &ipv4_sysctl_forward_strategy | |
291 | }, | |
e905a9ed | 292 | { |
1da177e4 LT |
293 | .ctl_name = NET_IPV4_DEFAULT_TTL, |
294 | .procname = "ip_default_ttl", | |
e905a9ed | 295 | .data = &sysctl_ip_default_ttl, |
1da177e4 LT |
296 | .maxlen = sizeof(int), |
297 | .mode = 0644, | |
298 | .proc_handler = &ipv4_doint_and_flush, | |
299 | .strategy = &ipv4_doint_and_flush_strategy, | |
300 | }, | |
e905a9ed | 301 | { |
1da177e4 LT |
302 | .ctl_name = NET_IPV4_NO_PMTU_DISC, |
303 | .procname = "ip_no_pmtu_disc", | |
304 | .data = &ipv4_config.no_pmtu_disc, | |
305 | .maxlen = sizeof(int), | |
306 | .mode = 0644, | |
307 | .proc_handler = &proc_dointvec | |
308 | }, | |
309 | { | |
310 | .ctl_name = NET_IPV4_NONLOCAL_BIND, | |
311 | .procname = "ip_nonlocal_bind", | |
312 | .data = &sysctl_ip_nonlocal_bind, | |
313 | .maxlen = sizeof(int), | |
314 | .mode = 0644, | |
315 | .proc_handler = &proc_dointvec | |
316 | }, | |
317 | { | |
318 | .ctl_name = NET_IPV4_TCP_SYN_RETRIES, | |
319 | .procname = "tcp_syn_retries", | |
320 | .data = &sysctl_tcp_syn_retries, | |
321 | .maxlen = sizeof(int), | |
322 | .mode = 0644, | |
323 | .proc_handler = &proc_dointvec | |
324 | }, | |
325 | { | |
326 | .ctl_name = NET_TCP_SYNACK_RETRIES, | |
327 | .procname = "tcp_synack_retries", | |
328 | .data = &sysctl_tcp_synack_retries, | |
329 | .maxlen = sizeof(int), | |
330 | .mode = 0644, | |
331 | .proc_handler = &proc_dointvec | |
332 | }, | |
333 | { | |
334 | .ctl_name = NET_TCP_MAX_ORPHANS, | |
335 | .procname = "tcp_max_orphans", | |
336 | .data = &sysctl_tcp_max_orphans, | |
337 | .maxlen = sizeof(int), | |
338 | .mode = 0644, | |
339 | .proc_handler = &proc_dointvec | |
340 | }, | |
341 | { | |
342 | .ctl_name = NET_TCP_MAX_TW_BUCKETS, | |
343 | .procname = "tcp_max_tw_buckets", | |
295ff7ed | 344 | .data = &tcp_death_row.sysctl_max_tw_buckets, |
1da177e4 LT |
345 | .maxlen = sizeof(int), |
346 | .mode = 0644, | |
347 | .proc_handler = &proc_dointvec | |
348 | }, | |
349 | { | |
350 | .ctl_name = NET_IPV4_IPFRAG_HIGH_THRESH, | |
351 | .procname = "ipfrag_high_thresh", | |
04128f23 | 352 | .data = &ip4_frags_ctl.high_thresh, |
1da177e4 LT |
353 | .maxlen = sizeof(int), |
354 | .mode = 0644, | |
355 | .proc_handler = &proc_dointvec | |
356 | }, | |
357 | { | |
358 | .ctl_name = NET_IPV4_IPFRAG_LOW_THRESH, | |
359 | .procname = "ipfrag_low_thresh", | |
04128f23 | 360 | .data = &ip4_frags_ctl.low_thresh, |
1da177e4 LT |
361 | .maxlen = sizeof(int), |
362 | .mode = 0644, | |
363 | .proc_handler = &proc_dointvec | |
364 | }, | |
365 | { | |
366 | .ctl_name = NET_IPV4_DYNADDR, | |
367 | .procname = "ip_dynaddr", | |
368 | .data = &sysctl_ip_dynaddr, | |
369 | .maxlen = sizeof(int), | |
370 | .mode = 0644, | |
371 | .proc_handler = &proc_dointvec | |
372 | }, | |
373 | { | |
374 | .ctl_name = NET_IPV4_IPFRAG_TIME, | |
375 | .procname = "ipfrag_time", | |
04128f23 | 376 | .data = &ip4_frags_ctl.timeout, |
1da177e4 LT |
377 | .maxlen = sizeof(int), |
378 | .mode = 0644, | |
379 | .proc_handler = &proc_dointvec_jiffies, | |
380 | .strategy = &sysctl_jiffies | |
381 | }, | |
382 | { | |
383 | .ctl_name = NET_IPV4_TCP_KEEPALIVE_TIME, | |
384 | .procname = "tcp_keepalive_time", | |
385 | .data = &sysctl_tcp_keepalive_time, | |
386 | .maxlen = sizeof(int), | |
387 | .mode = 0644, | |
388 | .proc_handler = &proc_dointvec_jiffies, | |
389 | .strategy = &sysctl_jiffies | |
390 | }, | |
391 | { | |
392 | .ctl_name = NET_IPV4_TCP_KEEPALIVE_PROBES, | |
393 | .procname = "tcp_keepalive_probes", | |
394 | .data = &sysctl_tcp_keepalive_probes, | |
395 | .maxlen = sizeof(int), | |
396 | .mode = 0644, | |
397 | .proc_handler = &proc_dointvec | |
398 | }, | |
399 | { | |
400 | .ctl_name = NET_IPV4_TCP_KEEPALIVE_INTVL, | |
401 | .procname = "tcp_keepalive_intvl", | |
402 | .data = &sysctl_tcp_keepalive_intvl, | |
403 | .maxlen = sizeof(int), | |
404 | .mode = 0644, | |
405 | .proc_handler = &proc_dointvec_jiffies, | |
406 | .strategy = &sysctl_jiffies | |
407 | }, | |
408 | { | |
409 | .ctl_name = NET_IPV4_TCP_RETRIES1, | |
410 | .procname = "tcp_retries1", | |
411 | .data = &sysctl_tcp_retries1, | |
412 | .maxlen = sizeof(int), | |
413 | .mode = 0644, | |
414 | .proc_handler = &proc_dointvec_minmax, | |
415 | .strategy = &sysctl_intvec, | |
416 | .extra2 = &tcp_retr1_max | |
417 | }, | |
418 | { | |
419 | .ctl_name = NET_IPV4_TCP_RETRIES2, | |
420 | .procname = "tcp_retries2", | |
421 | .data = &sysctl_tcp_retries2, | |
422 | .maxlen = sizeof(int), | |
423 | .mode = 0644, | |
424 | .proc_handler = &proc_dointvec | |
425 | }, | |
426 | { | |
427 | .ctl_name = NET_IPV4_TCP_FIN_TIMEOUT, | |
428 | .procname = "tcp_fin_timeout", | |
429 | .data = &sysctl_tcp_fin_timeout, | |
430 | .maxlen = sizeof(int), | |
431 | .mode = 0644, | |
432 | .proc_handler = &proc_dointvec_jiffies, | |
433 | .strategy = &sysctl_jiffies | |
434 | }, | |
435 | #ifdef CONFIG_SYN_COOKIES | |
436 | { | |
437 | .ctl_name = NET_TCP_SYNCOOKIES, | |
438 | .procname = "tcp_syncookies", | |
439 | .data = &sysctl_tcp_syncookies, | |
440 | .maxlen = sizeof(int), | |
441 | .mode = 0644, | |
442 | .proc_handler = &proc_dointvec | |
443 | }, | |
444 | #endif | |
445 | { | |
446 | .ctl_name = NET_TCP_TW_RECYCLE, | |
447 | .procname = "tcp_tw_recycle", | |
295ff7ed | 448 | .data = &tcp_death_row.sysctl_tw_recycle, |
1da177e4 LT |
449 | .maxlen = sizeof(int), |
450 | .mode = 0644, | |
451 | .proc_handler = &proc_dointvec | |
452 | }, | |
453 | { | |
454 | .ctl_name = NET_TCP_ABORT_ON_OVERFLOW, | |
455 | .procname = "tcp_abort_on_overflow", | |
456 | .data = &sysctl_tcp_abort_on_overflow, | |
457 | .maxlen = sizeof(int), | |
458 | .mode = 0644, | |
459 | .proc_handler = &proc_dointvec | |
460 | }, | |
461 | { | |
462 | .ctl_name = NET_TCP_STDURG, | |
463 | .procname = "tcp_stdurg", | |
464 | .data = &sysctl_tcp_stdurg, | |
465 | .maxlen = sizeof(int), | |
466 | .mode = 0644, | |
467 | .proc_handler = &proc_dointvec | |
468 | }, | |
469 | { | |
470 | .ctl_name = NET_TCP_RFC1337, | |
471 | .procname = "tcp_rfc1337", | |
472 | .data = &sysctl_tcp_rfc1337, | |
473 | .maxlen = sizeof(int), | |
474 | .mode = 0644, | |
475 | .proc_handler = &proc_dointvec | |
476 | }, | |
477 | { | |
478 | .ctl_name = NET_TCP_MAX_SYN_BACKLOG, | |
479 | .procname = "tcp_max_syn_backlog", | |
480 | .data = &sysctl_max_syn_backlog, | |
481 | .maxlen = sizeof(int), | |
482 | .mode = 0644, | |
483 | .proc_handler = &proc_dointvec | |
484 | }, | |
485 | { | |
486 | .ctl_name = NET_IPV4_LOCAL_PORT_RANGE, | |
487 | .procname = "ip_local_port_range", | |
488 | .data = &sysctl_local_port_range, | |
489 | .maxlen = sizeof(sysctl_local_port_range), | |
490 | .mode = 0644, | |
227b60f5 SH |
491 | .proc_handler = &ipv4_local_port_range, |
492 | .strategy = &ipv4_sysctl_local_port_range, | |
1da177e4 LT |
493 | }, |
494 | { | |
495 | .ctl_name = NET_IPV4_ICMP_ECHO_IGNORE_ALL, | |
496 | .procname = "icmp_echo_ignore_all", | |
497 | .data = &sysctl_icmp_echo_ignore_all, | |
498 | .maxlen = sizeof(int), | |
499 | .mode = 0644, | |
500 | .proc_handler = &proc_dointvec | |
501 | }, | |
502 | { | |
503 | .ctl_name = NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS, | |
504 | .procname = "icmp_echo_ignore_broadcasts", | |
505 | .data = &sysctl_icmp_echo_ignore_broadcasts, | |
506 | .maxlen = sizeof(int), | |
507 | .mode = 0644, | |
508 | .proc_handler = &proc_dointvec | |
509 | }, | |
510 | { | |
511 | .ctl_name = NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES, | |
512 | .procname = "icmp_ignore_bogus_error_responses", | |
513 | .data = &sysctl_icmp_ignore_bogus_error_responses, | |
514 | .maxlen = sizeof(int), | |
515 | .mode = 0644, | |
516 | .proc_handler = &proc_dointvec | |
517 | }, | |
1c2fb7f9 S |
518 | { |
519 | .ctl_name = NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR, | |
520 | .procname = "icmp_errors_use_inbound_ifaddr", | |
521 | .data = &sysctl_icmp_errors_use_inbound_ifaddr, | |
522 | .maxlen = sizeof(int), | |
523 | .mode = 0644, | |
524 | .proc_handler = &proc_dointvec | |
525 | }, | |
1da177e4 LT |
526 | { |
527 | .ctl_name = NET_IPV4_ROUTE, | |
528 | .procname = "route", | |
529 | .maxlen = 0, | |
530 | .mode = 0555, | |
531 | .child = ipv4_route_table | |
532 | }, | |
533 | #ifdef CONFIG_IP_MULTICAST | |
534 | { | |
535 | .ctl_name = NET_IPV4_IGMP_MAX_MEMBERSHIPS, | |
536 | .procname = "igmp_max_memberships", | |
537 | .data = &sysctl_igmp_max_memberships, | |
538 | .maxlen = sizeof(int), | |
539 | .mode = 0644, | |
540 | .proc_handler = &proc_dointvec | |
541 | }, | |
542 | ||
543 | #endif | |
544 | { | |
545 | .ctl_name = NET_IPV4_IGMP_MAX_MSF, | |
546 | .procname = "igmp_max_msf", | |
547 | .data = &sysctl_igmp_max_msf, | |
548 | .maxlen = sizeof(int), | |
549 | .mode = 0644, | |
550 | .proc_handler = &proc_dointvec | |
551 | }, | |
552 | { | |
553 | .ctl_name = NET_IPV4_INET_PEER_THRESHOLD, | |
554 | .procname = "inet_peer_threshold", | |
555 | .data = &inet_peer_threshold, | |
556 | .maxlen = sizeof(int), | |
557 | .mode = 0644, | |
558 | .proc_handler = &proc_dointvec | |
559 | }, | |
560 | { | |
561 | .ctl_name = NET_IPV4_INET_PEER_MINTTL, | |
562 | .procname = "inet_peer_minttl", | |
563 | .data = &inet_peer_minttl, | |
564 | .maxlen = sizeof(int), | |
565 | .mode = 0644, | |
566 | .proc_handler = &proc_dointvec_jiffies, | |
567 | .strategy = &sysctl_jiffies | |
568 | }, | |
569 | { | |
570 | .ctl_name = NET_IPV4_INET_PEER_MAXTTL, | |
571 | .procname = "inet_peer_maxttl", | |
572 | .data = &inet_peer_maxttl, | |
573 | .maxlen = sizeof(int), | |
574 | .mode = 0644, | |
575 | .proc_handler = &proc_dointvec_jiffies, | |
576 | .strategy = &sysctl_jiffies | |
577 | }, | |
578 | { | |
579 | .ctl_name = NET_IPV4_INET_PEER_GC_MINTIME, | |
580 | .procname = "inet_peer_gc_mintime", | |
581 | .data = &inet_peer_gc_mintime, | |
582 | .maxlen = sizeof(int), | |
583 | .mode = 0644, | |
584 | .proc_handler = &proc_dointvec_jiffies, | |
585 | .strategy = &sysctl_jiffies | |
586 | }, | |
587 | { | |
588 | .ctl_name = NET_IPV4_INET_PEER_GC_MAXTIME, | |
589 | .procname = "inet_peer_gc_maxtime", | |
590 | .data = &inet_peer_gc_maxtime, | |
591 | .maxlen = sizeof(int), | |
592 | .mode = 0644, | |
593 | .proc_handler = &proc_dointvec_jiffies, | |
594 | .strategy = &sysctl_jiffies | |
595 | }, | |
596 | { | |
597 | .ctl_name = NET_TCP_ORPHAN_RETRIES, | |
598 | .procname = "tcp_orphan_retries", | |
599 | .data = &sysctl_tcp_orphan_retries, | |
600 | .maxlen = sizeof(int), | |
601 | .mode = 0644, | |
602 | .proc_handler = &proc_dointvec | |
603 | }, | |
604 | { | |
605 | .ctl_name = NET_TCP_FACK, | |
606 | .procname = "tcp_fack", | |
607 | .data = &sysctl_tcp_fack, | |
608 | .maxlen = sizeof(int), | |
609 | .mode = 0644, | |
610 | .proc_handler = &proc_dointvec | |
611 | }, | |
612 | { | |
613 | .ctl_name = NET_TCP_REORDERING, | |
614 | .procname = "tcp_reordering", | |
615 | .data = &sysctl_tcp_reordering, | |
616 | .maxlen = sizeof(int), | |
617 | .mode = 0644, | |
618 | .proc_handler = &proc_dointvec | |
619 | }, | |
620 | { | |
621 | .ctl_name = NET_TCP_ECN, | |
622 | .procname = "tcp_ecn", | |
623 | .data = &sysctl_tcp_ecn, | |
624 | .maxlen = sizeof(int), | |
625 | .mode = 0644, | |
626 | .proc_handler = &proc_dointvec | |
627 | }, | |
628 | { | |
629 | .ctl_name = NET_TCP_DSACK, | |
630 | .procname = "tcp_dsack", | |
631 | .data = &sysctl_tcp_dsack, | |
632 | .maxlen = sizeof(int), | |
633 | .mode = 0644, | |
634 | .proc_handler = &proc_dointvec | |
635 | }, | |
636 | { | |
637 | .ctl_name = NET_TCP_MEM, | |
638 | .procname = "tcp_mem", | |
639 | .data = &sysctl_tcp_mem, | |
640 | .maxlen = sizeof(sysctl_tcp_mem), | |
641 | .mode = 0644, | |
642 | .proc_handler = &proc_dointvec | |
643 | }, | |
644 | { | |
645 | .ctl_name = NET_TCP_WMEM, | |
646 | .procname = "tcp_wmem", | |
647 | .data = &sysctl_tcp_wmem, | |
648 | .maxlen = sizeof(sysctl_tcp_wmem), | |
649 | .mode = 0644, | |
650 | .proc_handler = &proc_dointvec | |
651 | }, | |
652 | { | |
653 | .ctl_name = NET_TCP_RMEM, | |
654 | .procname = "tcp_rmem", | |
655 | .data = &sysctl_tcp_rmem, | |
656 | .maxlen = sizeof(sysctl_tcp_rmem), | |
657 | .mode = 0644, | |
658 | .proc_handler = &proc_dointvec | |
659 | }, | |
660 | { | |
661 | .ctl_name = NET_TCP_APP_WIN, | |
662 | .procname = "tcp_app_win", | |
663 | .data = &sysctl_tcp_app_win, | |
664 | .maxlen = sizeof(int), | |
665 | .mode = 0644, | |
666 | .proc_handler = &proc_dointvec | |
667 | }, | |
668 | { | |
669 | .ctl_name = NET_TCP_ADV_WIN_SCALE, | |
670 | .procname = "tcp_adv_win_scale", | |
671 | .data = &sysctl_tcp_adv_win_scale, | |
672 | .maxlen = sizeof(int), | |
673 | .mode = 0644, | |
674 | .proc_handler = &proc_dointvec | |
675 | }, | |
676 | { | |
677 | .ctl_name = NET_IPV4_ICMP_RATELIMIT, | |
678 | .procname = "icmp_ratelimit", | |
679 | .data = &sysctl_icmp_ratelimit, | |
680 | .maxlen = sizeof(int), | |
681 | .mode = 0644, | |
682 | .proc_handler = &proc_dointvec | |
683 | }, | |
684 | { | |
685 | .ctl_name = NET_IPV4_ICMP_RATEMASK, | |
686 | .procname = "icmp_ratemask", | |
687 | .data = &sysctl_icmp_ratemask, | |
688 | .maxlen = sizeof(int), | |
689 | .mode = 0644, | |
690 | .proc_handler = &proc_dointvec | |
691 | }, | |
692 | { | |
693 | .ctl_name = NET_TCP_TW_REUSE, | |
694 | .procname = "tcp_tw_reuse", | |
695 | .data = &sysctl_tcp_tw_reuse, | |
696 | .maxlen = sizeof(int), | |
697 | .mode = 0644, | |
698 | .proc_handler = &proc_dointvec | |
699 | }, | |
700 | { | |
701 | .ctl_name = NET_TCP_FRTO, | |
702 | .procname = "tcp_frto", | |
703 | .data = &sysctl_tcp_frto, | |
704 | .maxlen = sizeof(int), | |
705 | .mode = 0644, | |
706 | .proc_handler = &proc_dointvec | |
707 | }, | |
3cfe3baa IJ |
708 | { |
709 | .ctl_name = NET_TCP_FRTO_RESPONSE, | |
710 | .procname = "tcp_frto_response", | |
711 | .data = &sysctl_tcp_frto_response, | |
712 | .maxlen = sizeof(int), | |
713 | .mode = 0644, | |
714 | .proc_handler = &proc_dointvec | |
715 | }, | |
1da177e4 LT |
716 | { |
717 | .ctl_name = NET_TCP_LOW_LATENCY, | |
718 | .procname = "tcp_low_latency", | |
719 | .data = &sysctl_tcp_low_latency, | |
720 | .maxlen = sizeof(int), | |
721 | .mode = 0644, | |
722 | .proc_handler = &proc_dointvec | |
723 | }, | |
724 | { | |
725 | .ctl_name = NET_IPV4_IPFRAG_SECRET_INTERVAL, | |
726 | .procname = "ipfrag_secret_interval", | |
04128f23 | 727 | .data = &ip4_frags_ctl.secret_interval, |
1da177e4 LT |
728 | .maxlen = sizeof(int), |
729 | .mode = 0644, | |
730 | .proc_handler = &proc_dointvec_jiffies, | |
731 | .strategy = &sysctl_jiffies | |
732 | }, | |
89cee8b1 | 733 | { |
89cee8b1 HX |
734 | .procname = "ipfrag_max_dist", |
735 | .data = &sysctl_ipfrag_max_dist, | |
736 | .maxlen = sizeof(int), | |
737 | .mode = 0644, | |
738 | .proc_handler = &proc_dointvec_minmax, | |
739 | .extra1 = &zero | |
740 | }, | |
1da177e4 LT |
741 | { |
742 | .ctl_name = NET_TCP_NO_METRICS_SAVE, | |
743 | .procname = "tcp_no_metrics_save", | |
744 | .data = &sysctl_tcp_nometrics_save, | |
745 | .maxlen = sizeof(int), | |
746 | .mode = 0644, | |
747 | .proc_handler = &proc_dointvec, | |
748 | }, | |
1da177e4 LT |
749 | { |
750 | .ctl_name = NET_TCP_MODERATE_RCVBUF, | |
751 | .procname = "tcp_moderate_rcvbuf", | |
752 | .data = &sysctl_tcp_moderate_rcvbuf, | |
753 | .maxlen = sizeof(int), | |
754 | .mode = 0644, | |
755 | .proc_handler = &proc_dointvec, | |
756 | }, | |
757 | { | |
758 | .ctl_name = NET_TCP_TSO_WIN_DIVISOR, | |
759 | .procname = "tcp_tso_win_divisor", | |
760 | .data = &sysctl_tcp_tso_win_divisor, | |
761 | .maxlen = sizeof(int), | |
762 | .mode = 0644, | |
763 | .proc_handler = &proc_dointvec, | |
764 | }, | |
765 | { | |
317a76f9 SH |
766 | .ctl_name = NET_TCP_CONG_CONTROL, |
767 | .procname = "tcp_congestion_control", | |
1da177e4 | 768 | .mode = 0644, |
317a76f9 SH |
769 | .maxlen = TCP_CA_NAME_MAX, |
770 | .proc_handler = &proc_tcp_congestion_control, | |
771 | .strategy = &sysctl_tcp_congestion_control, | |
1da177e4 | 772 | }, |
9772efb9 SH |
773 | { |
774 | .ctl_name = NET_TCP_ABC, | |
775 | .procname = "tcp_abc", | |
776 | .data = &sysctl_tcp_abc, | |
777 | .maxlen = sizeof(int), | |
778 | .mode = 0644, | |
779 | .proc_handler = &proc_dointvec, | |
780 | }, | |
5d424d5a JH |
781 | { |
782 | .ctl_name = NET_TCP_MTU_PROBING, | |
783 | .procname = "tcp_mtu_probing", | |
784 | .data = &sysctl_tcp_mtu_probing, | |
785 | .maxlen = sizeof(int), | |
786 | .mode = 0644, | |
787 | .proc_handler = &proc_dointvec, | |
788 | }, | |
789 | { | |
790 | .ctl_name = NET_TCP_BASE_MSS, | |
791 | .procname = "tcp_base_mss", | |
792 | .data = &sysctl_tcp_base_mss, | |
793 | .maxlen = sizeof(int), | |
794 | .mode = 0644, | |
795 | .proc_handler = &proc_dointvec, | |
796 | }, | |
e905a9ed | 797 | { |
15d99e02 RJ |
798 | .ctl_name = NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS, |
799 | .procname = "tcp_workaround_signed_windows", | |
800 | .data = &sysctl_tcp_workaround_signed_windows, | |
801 | .maxlen = sizeof(int), | |
802 | .mode = 0644, | |
803 | .proc_handler = &proc_dointvec | |
804 | }, | |
95937825 CL |
805 | #ifdef CONFIG_NET_DMA |
806 | { | |
807 | .ctl_name = NET_TCP_DMA_COPYBREAK, | |
808 | .procname = "tcp_dma_copybreak", | |
809 | .data = &sysctl_tcp_dma_copybreak, | |
810 | .maxlen = sizeof(int), | |
811 | .mode = 0644, | |
812 | .proc_handler = &proc_dointvec | |
813 | }, | |
814 | #endif | |
35089bb2 DM |
815 | { |
816 | .ctl_name = NET_TCP_SLOW_START_AFTER_IDLE, | |
817 | .procname = "tcp_slow_start_after_idle", | |
818 | .data = &sysctl_tcp_slow_start_after_idle, | |
819 | .maxlen = sizeof(int), | |
820 | .mode = 0644, | |
821 | .proc_handler = &proc_dointvec | |
822 | }, | |
446fda4f PM |
823 | #ifdef CONFIG_NETLABEL |
824 | { | |
825 | .ctl_name = NET_CIPSOV4_CACHE_ENABLE, | |
826 | .procname = "cipso_cache_enable", | |
827 | .data = &cipso_v4_cache_enabled, | |
828 | .maxlen = sizeof(int), | |
829 | .mode = 0644, | |
830 | .proc_handler = &proc_dointvec, | |
831 | }, | |
832 | { | |
833 | .ctl_name = NET_CIPSOV4_CACHE_BUCKET_SIZE, | |
834 | .procname = "cipso_cache_bucket_size", | |
835 | .data = &cipso_v4_cache_bucketsize, | |
836 | .maxlen = sizeof(int), | |
837 | .mode = 0644, | |
838 | .proc_handler = &proc_dointvec, | |
839 | }, | |
840 | { | |
841 | .ctl_name = NET_CIPSOV4_RBM_OPTFMT, | |
842 | .procname = "cipso_rbm_optfmt", | |
843 | .data = &cipso_v4_rbm_optfmt, | |
844 | .maxlen = sizeof(int), | |
845 | .mode = 0644, | |
846 | .proc_handler = &proc_dointvec, | |
847 | }, | |
848 | { | |
849 | .ctl_name = NET_CIPSOV4_RBM_STRICTVALID, | |
850 | .procname = "cipso_rbm_strictvalid", | |
851 | .data = &cipso_v4_rbm_strictvalid, | |
852 | .maxlen = sizeof(int), | |
853 | .mode = 0644, | |
854 | .proc_handler = &proc_dointvec, | |
855 | }, | |
856 | #endif /* CONFIG_NETLABEL */ | |
3ff825b2 | 857 | { |
3ff825b2 SH |
858 | .procname = "tcp_available_congestion_control", |
859 | .maxlen = TCP_CA_BUF_MAX, | |
860 | .mode = 0444, | |
861 | .proc_handler = &proc_tcp_available_congestion_control, | |
862 | }, | |
ce7bc3bf SH |
863 | { |
864 | .ctl_name = NET_TCP_ALLOWED_CONG_CONTROL, | |
865 | .procname = "tcp_allowed_congestion_control", | |
866 | .maxlen = TCP_CA_BUF_MAX, | |
867 | .mode = 0644, | |
868 | .proc_handler = &proc_allowed_congestion_control, | |
869 | .strategy = &strategy_allowed_congestion_control, | |
870 | }, | |
886236c1 JH |
871 | { |
872 | .ctl_name = NET_TCP_MAX_SSTHRESH, | |
873 | .procname = "tcp_max_ssthresh", | |
874 | .data = &sysctl_tcp_max_ssthresh, | |
875 | .maxlen = sizeof(int), | |
876 | .mode = 0644, | |
877 | .proc_handler = &proc_dointvec, | |
878 | }, | |
1da177e4 LT |
879 | { .ctl_name = 0 } |
880 | }; |