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