Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * sysctl_net_ipv4.c: sysctl interface to net IPV4 subsystem. |
| 3 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | * Begun April 1, 1996, Mike Shaver. |
| 5 | * Added /proc/sys/net/ipv4 directory entry (empty =) ). [MS] |
| 6 | */ |
| 7 | |
| 8 | #include <linux/mm.h> |
| 9 | #include <linux/module.h> |
| 10 | #include <linux/sysctl.h> |
Arnaldo Carvalho de Melo | 2038073 | 2005-08-16 02:18:02 -0300 | [diff] [blame] | 11 | #include <linux/igmp.h> |
Arnaldo Carvalho de Melo | 14c8502 | 2005-12-27 02:43:12 -0200 | [diff] [blame] | 12 | #include <linux/inetdevice.h> |
Stephen Hemminger | 227b60f | 2007-10-10 17:30:46 -0700 | [diff] [blame] | 13 | #include <linux/seqlock.h> |
Pavel Emelyanov | 3e37c3f | 2007-12-05 01:41:26 -0800 | [diff] [blame] | 14 | #include <linux/init.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 15 | #include <linux/slab.h> |
Vasiliy Kulikov | c319b4d | 2011-05-13 10:01:00 +0000 | [diff] [blame] | 16 | #include <linux/nsproxy.h> |
Glauber Costa | 3dc43e3 | 2011-12-11 21:47:05 +0000 | [diff] [blame] | 17 | #include <linux/swap.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | #include <net/snmp.h> |
Arnaldo Carvalho de Melo | 2038073 | 2005-08-16 02:18:02 -0300 | [diff] [blame] | 19 | #include <net/icmp.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | #include <net/ip.h> |
| 21 | #include <net/route.h> |
| 22 | #include <net/tcp.h> |
Hideo Aoki | 95766ff | 2007-12-31 00:29:24 -0800 | [diff] [blame] | 23 | #include <net/udp.h> |
Paul Moore | 446fda4 | 2006-08-03 16:48:06 -0700 | [diff] [blame] | 24 | #include <net/cipso_ipv4.h> |
Pavel Emelyanov | 04128f2 | 2007-10-15 02:33:45 -0700 | [diff] [blame] | 25 | #include <net/inet_frag.h> |
Vasiliy Kulikov | c319b4d | 2011-05-13 10:01:00 +0000 | [diff] [blame] | 26 | #include <net/ping.h> |
Glauber Costa | 3aaabe2 | 2011-12-11 21:47:06 +0000 | [diff] [blame] | 27 | #include <net/tcp_memcontrol.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | |
Herbert Xu | 89cee8b | 2005-12-13 23:14:27 -0800 | [diff] [blame] | 29 | static int zero; |
YOSHIFUJI Hideaki | e905a9e | 2007-02-09 23:24:47 +0900 | [diff] [blame] | 30 | static int tcp_retr1_max = 255; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | static int ip_local_port_range_min[] = { 1, 1 }; |
| 32 | static int ip_local_port_range_max[] = { 65535, 65535 }; |
Alexey Dobriyan | 0147fc0 | 2010-11-22 12:54:21 +0000 | [diff] [blame] | 33 | static int tcp_adv_win_scale_min = -31; |
| 34 | static int tcp_adv_win_scale_max = 31; |
Eric Dumazet | 249fab7 | 2010-12-13 12:16:14 -0800 | [diff] [blame] | 35 | static int ip_ttl_min = 1; |
| 36 | static int ip_ttl_max = 255; |
Vasiliy Kulikov | c319b4d | 2011-05-13 10:01:00 +0000 | [diff] [blame] | 37 | static int ip_ping_group_range_min[] = { 0, 0 }; |
| 38 | static int ip_ping_group_range_max[] = { GID_T_MAX, GID_T_MAX }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | |
Stephen Hemminger | 227b60f | 2007-10-10 17:30:46 -0700 | [diff] [blame] | 40 | /* Update system visible IP port range */ |
| 41 | static void set_local_port_range(int range[2]) |
| 42 | { |
Eric Dumazet | 3c689b7 | 2008-10-08 14:18:04 -0700 | [diff] [blame] | 43 | write_seqlock(&sysctl_local_ports.lock); |
| 44 | sysctl_local_ports.range[0] = range[0]; |
| 45 | sysctl_local_ports.range[1] = range[1]; |
| 46 | write_sequnlock(&sysctl_local_ports.lock); |
Stephen Hemminger | 227b60f | 2007-10-10 17:30:46 -0700 | [diff] [blame] | 47 | } |
| 48 | |
| 49 | /* Validate changes from /proc interface. */ |
Alexey Dobriyan | 8d65af7 | 2009-09-23 15:57:19 -0700 | [diff] [blame] | 50 | static int ipv4_local_port_range(ctl_table *table, int write, |
Stephen Hemminger | 227b60f | 2007-10-10 17:30:46 -0700 | [diff] [blame] | 51 | void __user *buffer, |
| 52 | size_t *lenp, loff_t *ppos) |
| 53 | { |
| 54 | int ret; |
Eric Dumazet | 3c689b7 | 2008-10-08 14:18:04 -0700 | [diff] [blame] | 55 | int range[2]; |
Stephen Hemminger | 227b60f | 2007-10-10 17:30:46 -0700 | [diff] [blame] | 56 | ctl_table tmp = { |
| 57 | .data = &range, |
| 58 | .maxlen = sizeof(range), |
| 59 | .mode = table->mode, |
| 60 | .extra1 = &ip_local_port_range_min, |
| 61 | .extra2 = &ip_local_port_range_max, |
| 62 | }; |
| 63 | |
Eric Dumazet | 3c689b7 | 2008-10-08 14:18:04 -0700 | [diff] [blame] | 64 | inet_get_local_port_range(range, range + 1); |
Alexey Dobriyan | 8d65af7 | 2009-09-23 15:57:19 -0700 | [diff] [blame] | 65 | ret = proc_dointvec_minmax(&tmp, write, buffer, lenp, ppos); |
Stephen Hemminger | 227b60f | 2007-10-10 17:30:46 -0700 | [diff] [blame] | 66 | |
| 67 | if (write && ret == 0) { |
Anton Arapov | a25de53 | 2007-10-18 22:00:17 -0700 | [diff] [blame] | 68 | if (range[1] < range[0]) |
Stephen Hemminger | 227b60f | 2007-10-10 17:30:46 -0700 | [diff] [blame] | 69 | ret = -EINVAL; |
| 70 | else |
| 71 | set_local_port_range(range); |
| 72 | } |
| 73 | |
| 74 | return ret; |
| 75 | } |
| 76 | |
Vasiliy Kulikov | c319b4d | 2011-05-13 10:01:00 +0000 | [diff] [blame] | 77 | |
Eric Dumazet | e6560d4 | 2011-12-14 03:51:28 +0000 | [diff] [blame] | 78 | static void inet_get_ping_group_range_table(struct ctl_table *table, gid_t *low, gid_t *high) |
Vasiliy Kulikov | c319b4d | 2011-05-13 10:01:00 +0000 | [diff] [blame] | 79 | { |
| 80 | gid_t *data = table->data; |
| 81 | unsigned seq; |
| 82 | do { |
| 83 | seq = read_seqbegin(&sysctl_local_ports.lock); |
| 84 | |
| 85 | *low = data[0]; |
| 86 | *high = data[1]; |
| 87 | } while (read_seqretry(&sysctl_local_ports.lock, seq)); |
| 88 | } |
| 89 | |
| 90 | /* Update system visible IP port range */ |
Eric Dumazet | e6560d4 | 2011-12-14 03:51:28 +0000 | [diff] [blame] | 91 | static void set_ping_group_range(struct ctl_table *table, gid_t range[2]) |
Vasiliy Kulikov | c319b4d | 2011-05-13 10:01:00 +0000 | [diff] [blame] | 92 | { |
| 93 | gid_t *data = table->data; |
| 94 | write_seqlock(&sysctl_local_ports.lock); |
| 95 | data[0] = range[0]; |
| 96 | data[1] = range[1]; |
| 97 | write_sequnlock(&sysctl_local_ports.lock); |
| 98 | } |
| 99 | |
| 100 | /* Validate changes from /proc interface. */ |
| 101 | static int ipv4_ping_group_range(ctl_table *table, int write, |
| 102 | void __user *buffer, |
| 103 | size_t *lenp, loff_t *ppos) |
| 104 | { |
| 105 | int ret; |
| 106 | gid_t range[2]; |
| 107 | ctl_table tmp = { |
| 108 | .data = &range, |
| 109 | .maxlen = sizeof(range), |
| 110 | .mode = table->mode, |
| 111 | .extra1 = &ip_ping_group_range_min, |
| 112 | .extra2 = &ip_ping_group_range_max, |
| 113 | }; |
| 114 | |
| 115 | inet_get_ping_group_range_table(table, range, range + 1); |
| 116 | ret = proc_dointvec_minmax(&tmp, write, buffer, lenp, ppos); |
| 117 | |
| 118 | if (write && ret == 0) |
| 119 | set_ping_group_range(table, range); |
| 120 | |
| 121 | return ret; |
| 122 | } |
| 123 | |
Alexey Dobriyan | 8d65af7 | 2009-09-23 15:57:19 -0700 | [diff] [blame] | 124 | static int proc_tcp_congestion_control(ctl_table *ctl, int write, |
Stephen Hemminger | 317a76f | 2005-06-23 12:19:55 -0700 | [diff] [blame] | 125 | void __user *buffer, size_t *lenp, loff_t *ppos) |
| 126 | { |
| 127 | char val[TCP_CA_NAME_MAX]; |
| 128 | ctl_table tbl = { |
| 129 | .data = val, |
| 130 | .maxlen = TCP_CA_NAME_MAX, |
| 131 | }; |
| 132 | int ret; |
| 133 | |
| 134 | tcp_get_default_congestion_control(val); |
| 135 | |
Alexey Dobriyan | 8d65af7 | 2009-09-23 15:57:19 -0700 | [diff] [blame] | 136 | ret = proc_dostring(&tbl, write, buffer, lenp, ppos); |
Stephen Hemminger | 317a76f | 2005-06-23 12:19:55 -0700 | [diff] [blame] | 137 | if (write && ret == 0) |
| 138 | ret = tcp_set_default_congestion_control(val); |
| 139 | return ret; |
| 140 | } |
| 141 | |
Stephen Hemminger | 3ff825b | 2006-11-09 16:32:06 -0800 | [diff] [blame] | 142 | static int proc_tcp_available_congestion_control(ctl_table *ctl, |
Alexey Dobriyan | 8d65af7 | 2009-09-23 15:57:19 -0700 | [diff] [blame] | 143 | int write, |
Stephen Hemminger | 3ff825b | 2006-11-09 16:32:06 -0800 | [diff] [blame] | 144 | void __user *buffer, size_t *lenp, |
| 145 | loff_t *ppos) |
| 146 | { |
| 147 | ctl_table tbl = { .maxlen = TCP_CA_BUF_MAX, }; |
| 148 | int ret; |
| 149 | |
| 150 | tbl.data = kmalloc(tbl.maxlen, GFP_USER); |
| 151 | if (!tbl.data) |
| 152 | return -ENOMEM; |
| 153 | tcp_get_available_congestion_control(tbl.data, TCP_CA_BUF_MAX); |
Alexey Dobriyan | 8d65af7 | 2009-09-23 15:57:19 -0700 | [diff] [blame] | 154 | ret = proc_dostring(&tbl, write, buffer, lenp, ppos); |
Stephen Hemminger | 3ff825b | 2006-11-09 16:32:06 -0800 | [diff] [blame] | 155 | kfree(tbl.data); |
| 156 | return ret; |
| 157 | } |
| 158 | |
Stephen Hemminger | ce7bc3b | 2006-11-09 16:35:15 -0800 | [diff] [blame] | 159 | static int proc_allowed_congestion_control(ctl_table *ctl, |
Alexey Dobriyan | 8d65af7 | 2009-09-23 15:57:19 -0700 | [diff] [blame] | 160 | int write, |
Stephen Hemminger | ce7bc3b | 2006-11-09 16:35:15 -0800 | [diff] [blame] | 161 | void __user *buffer, size_t *lenp, |
| 162 | loff_t *ppos) |
| 163 | { |
| 164 | ctl_table tbl = { .maxlen = TCP_CA_BUF_MAX }; |
| 165 | int ret; |
| 166 | |
| 167 | tbl.data = kmalloc(tbl.maxlen, GFP_USER); |
| 168 | if (!tbl.data) |
| 169 | return -ENOMEM; |
| 170 | |
| 171 | tcp_get_allowed_congestion_control(tbl.data, tbl.maxlen); |
Alexey Dobriyan | 8d65af7 | 2009-09-23 15:57:19 -0700 | [diff] [blame] | 172 | ret = proc_dostring(&tbl, write, buffer, lenp, ppos); |
Stephen Hemminger | ce7bc3b | 2006-11-09 16:35:15 -0800 | [diff] [blame] | 173 | if (write && ret == 0) |
| 174 | ret = tcp_set_allowed_congestion_control(tbl.data); |
| 175 | kfree(tbl.data); |
| 176 | return ret; |
| 177 | } |
| 178 | |
Glauber Costa | 3dc43e3 | 2011-12-11 21:47:05 +0000 | [diff] [blame] | 179 | static int ipv4_tcp_mem(ctl_table *ctl, int write, |
| 180 | void __user *buffer, size_t *lenp, |
| 181 | loff_t *ppos) |
| 182 | { |
| 183 | int ret; |
| 184 | unsigned long vec[3]; |
| 185 | struct net *net = current->nsproxy->net_ns; |
Glauber Costa | 3aaabe2 | 2011-12-11 21:47:06 +0000 | [diff] [blame] | 186 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_KMEM |
| 187 | struct mem_cgroup *memcg; |
| 188 | #endif |
Glauber Costa | 3dc43e3 | 2011-12-11 21:47:05 +0000 | [diff] [blame] | 189 | |
| 190 | ctl_table tmp = { |
| 191 | .data = &vec, |
| 192 | .maxlen = sizeof(vec), |
| 193 | .mode = ctl->mode, |
| 194 | }; |
| 195 | |
| 196 | if (!write) { |
| 197 | ctl->data = &net->ipv4.sysctl_tcp_mem; |
| 198 | return proc_doulongvec_minmax(ctl, write, buffer, lenp, ppos); |
| 199 | } |
| 200 | |
| 201 | ret = proc_doulongvec_minmax(&tmp, write, buffer, lenp, ppos); |
| 202 | if (ret) |
| 203 | return ret; |
| 204 | |
Glauber Costa | 3aaabe2 | 2011-12-11 21:47:06 +0000 | [diff] [blame] | 205 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_KMEM |
| 206 | rcu_read_lock(); |
| 207 | memcg = mem_cgroup_from_task(current); |
| 208 | |
| 209 | tcp_prot_mem(memcg, vec[0], 0); |
| 210 | tcp_prot_mem(memcg, vec[1], 1); |
| 211 | tcp_prot_mem(memcg, vec[2], 2); |
| 212 | rcu_read_unlock(); |
| 213 | #endif |
| 214 | |
Glauber Costa | 3dc43e3 | 2011-12-11 21:47:05 +0000 | [diff] [blame] | 215 | net->ipv4.sysctl_tcp_mem[0] = vec[0]; |
| 216 | net->ipv4.sysctl_tcp_mem[1] = vec[1]; |
| 217 | net->ipv4.sysctl_tcp_mem[2] = vec[2]; |
| 218 | |
| 219 | return 0; |
| 220 | } |
| 221 | |
Pavel Emelyanov | 3e37c3f | 2007-12-05 01:41:26 -0800 | [diff] [blame] | 222 | static struct ctl_table ipv4_table[] = { |
YOSHIFUJI Hideaki | e905a9e | 2007-02-09 23:24:47 +0900 | [diff] [blame] | 223 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 224 | .procname = "tcp_timestamps", |
| 225 | .data = &sysctl_tcp_timestamps, |
| 226 | .maxlen = sizeof(int), |
| 227 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 228 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 229 | }, |
YOSHIFUJI Hideaki | e905a9e | 2007-02-09 23:24:47 +0900 | [diff] [blame] | 230 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 231 | .procname = "tcp_window_scaling", |
| 232 | .data = &sysctl_tcp_window_scaling, |
| 233 | .maxlen = sizeof(int), |
| 234 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 235 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 236 | }, |
YOSHIFUJI Hideaki | e905a9e | 2007-02-09 23:24:47 +0900 | [diff] [blame] | 237 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 238 | .procname = "tcp_sack", |
| 239 | .data = &sysctl_tcp_sack, |
| 240 | .maxlen = sizeof(int), |
| 241 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 242 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 243 | }, |
YOSHIFUJI Hideaki | e905a9e | 2007-02-09 23:24:47 +0900 | [diff] [blame] | 244 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 245 | .procname = "tcp_retrans_collapse", |
| 246 | .data = &sysctl_tcp_retrans_collapse, |
| 247 | .maxlen = sizeof(int), |
| 248 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 249 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 250 | }, |
YOSHIFUJI Hideaki | e905a9e | 2007-02-09 23:24:47 +0900 | [diff] [blame] | 251 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 252 | .procname = "ip_default_ttl", |
YOSHIFUJI Hideaki | e905a9e | 2007-02-09 23:24:47 +0900 | [diff] [blame] | 253 | .data = &sysctl_ip_default_ttl, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 254 | .maxlen = sizeof(int), |
| 255 | .mode = 0644, |
Eric Dumazet | 249fab7 | 2010-12-13 12:16:14 -0800 | [diff] [blame] | 256 | .proc_handler = proc_dointvec_minmax, |
| 257 | .extra1 = &ip_ttl_min, |
| 258 | .extra2 = &ip_ttl_max, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 259 | }, |
YOSHIFUJI Hideaki | e905a9e | 2007-02-09 23:24:47 +0900 | [diff] [blame] | 260 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 261 | .procname = "ip_no_pmtu_disc", |
| 262 | .data = &ipv4_config.no_pmtu_disc, |
| 263 | .maxlen = sizeof(int), |
| 264 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 265 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 266 | }, |
| 267 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 268 | .procname = "ip_nonlocal_bind", |
| 269 | .data = &sysctl_ip_nonlocal_bind, |
| 270 | .maxlen = sizeof(int), |
| 271 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 272 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 273 | }, |
| 274 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 275 | .procname = "tcp_syn_retries", |
| 276 | .data = &sysctl_tcp_syn_retries, |
| 277 | .maxlen = sizeof(int), |
| 278 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 279 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 280 | }, |
| 281 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 282 | .procname = "tcp_synack_retries", |
| 283 | .data = &sysctl_tcp_synack_retries, |
| 284 | .maxlen = sizeof(int), |
| 285 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 286 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 287 | }, |
| 288 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 289 | .procname = "tcp_max_orphans", |
| 290 | .data = &sysctl_tcp_max_orphans, |
| 291 | .maxlen = sizeof(int), |
| 292 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 293 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 294 | }, |
| 295 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 296 | .procname = "tcp_max_tw_buckets", |
Arnaldo Carvalho de Melo | 295ff7e | 2005-08-09 20:44:40 -0700 | [diff] [blame] | 297 | .data = &tcp_death_row.sysctl_max_tw_buckets, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 298 | .maxlen = sizeof(int), |
| 299 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 300 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 301 | }, |
| 302 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 303 | .procname = "ip_dynaddr", |
| 304 | .data = &sysctl_ip_dynaddr, |
| 305 | .maxlen = sizeof(int), |
| 306 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 307 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 308 | }, |
| 309 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 310 | .procname = "tcp_keepalive_time", |
| 311 | .data = &sysctl_tcp_keepalive_time, |
| 312 | .maxlen = sizeof(int), |
| 313 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 314 | .proc_handler = proc_dointvec_jiffies, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 315 | }, |
| 316 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 317 | .procname = "tcp_keepalive_probes", |
| 318 | .data = &sysctl_tcp_keepalive_probes, |
| 319 | .maxlen = sizeof(int), |
| 320 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 321 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 322 | }, |
| 323 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 324 | .procname = "tcp_keepalive_intvl", |
| 325 | .data = &sysctl_tcp_keepalive_intvl, |
| 326 | .maxlen = sizeof(int), |
| 327 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 328 | .proc_handler = proc_dointvec_jiffies, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 329 | }, |
| 330 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 331 | .procname = "tcp_retries1", |
| 332 | .data = &sysctl_tcp_retries1, |
| 333 | .maxlen = sizeof(int), |
| 334 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 335 | .proc_handler = proc_dointvec_minmax, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 336 | .extra2 = &tcp_retr1_max |
| 337 | }, |
| 338 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 339 | .procname = "tcp_retries2", |
| 340 | .data = &sysctl_tcp_retries2, |
| 341 | .maxlen = sizeof(int), |
| 342 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 343 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 344 | }, |
| 345 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 346 | .procname = "tcp_fin_timeout", |
| 347 | .data = &sysctl_tcp_fin_timeout, |
| 348 | .maxlen = sizeof(int), |
| 349 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 350 | .proc_handler = proc_dointvec_jiffies, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 351 | }, |
| 352 | #ifdef CONFIG_SYN_COOKIES |
| 353 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 354 | .procname = "tcp_syncookies", |
| 355 | .data = &sysctl_tcp_syncookies, |
| 356 | .maxlen = sizeof(int), |
| 357 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 358 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 359 | }, |
| 360 | #endif |
| 361 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 362 | .procname = "tcp_tw_recycle", |
Arnaldo Carvalho de Melo | 295ff7e | 2005-08-09 20:44:40 -0700 | [diff] [blame] | 363 | .data = &tcp_death_row.sysctl_tw_recycle, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 364 | .maxlen = sizeof(int), |
| 365 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 366 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 367 | }, |
| 368 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 369 | .procname = "tcp_abort_on_overflow", |
| 370 | .data = &sysctl_tcp_abort_on_overflow, |
| 371 | .maxlen = sizeof(int), |
| 372 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 373 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 374 | }, |
| 375 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 376 | .procname = "tcp_stdurg", |
| 377 | .data = &sysctl_tcp_stdurg, |
| 378 | .maxlen = sizeof(int), |
| 379 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 380 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 381 | }, |
| 382 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 383 | .procname = "tcp_rfc1337", |
| 384 | .data = &sysctl_tcp_rfc1337, |
| 385 | .maxlen = sizeof(int), |
| 386 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 387 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 388 | }, |
| 389 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 390 | .procname = "tcp_max_syn_backlog", |
| 391 | .data = &sysctl_max_syn_backlog, |
| 392 | .maxlen = sizeof(int), |
| 393 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 394 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 395 | }, |
| 396 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 397 | .procname = "ip_local_port_range", |
Eric Dumazet | 3c689b7 | 2008-10-08 14:18:04 -0700 | [diff] [blame] | 398 | .data = &sysctl_local_ports.range, |
| 399 | .maxlen = sizeof(sysctl_local_ports.range), |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 400 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 401 | .proc_handler = ipv4_local_port_range, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 402 | }, |
Amerigo Wang | e3826f1 | 2010-05-05 00:27:06 +0000 | [diff] [blame] | 403 | { |
| 404 | .procname = "ip_local_reserved_ports", |
| 405 | .data = NULL, /* initialized in sysctl_ipv4_init */ |
| 406 | .maxlen = 65536, |
| 407 | .mode = 0644, |
| 408 | .proc_handler = proc_do_large_bitmap, |
| 409 | }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 410 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 411 | .procname = "igmp_max_memberships", |
| 412 | .data = &sysctl_igmp_max_memberships, |
| 413 | .maxlen = sizeof(int), |
| 414 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 415 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 416 | }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 417 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 418 | .procname = "igmp_max_msf", |
| 419 | .data = &sysctl_igmp_max_msf, |
| 420 | .maxlen = sizeof(int), |
| 421 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 422 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 423 | }, |
| 424 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 425 | .procname = "inet_peer_threshold", |
| 426 | .data = &inet_peer_threshold, |
| 427 | .maxlen = sizeof(int), |
| 428 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 429 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 430 | }, |
| 431 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 432 | .procname = "inet_peer_minttl", |
| 433 | .data = &inet_peer_minttl, |
| 434 | .maxlen = sizeof(int), |
| 435 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 436 | .proc_handler = proc_dointvec_jiffies, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 437 | }, |
| 438 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 439 | .procname = "inet_peer_maxttl", |
| 440 | .data = &inet_peer_maxttl, |
| 441 | .maxlen = sizeof(int), |
| 442 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 443 | .proc_handler = proc_dointvec_jiffies, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 444 | }, |
| 445 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 446 | .procname = "tcp_orphan_retries", |
| 447 | .data = &sysctl_tcp_orphan_retries, |
| 448 | .maxlen = sizeof(int), |
| 449 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 450 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 451 | }, |
| 452 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 453 | .procname = "tcp_fack", |
| 454 | .data = &sysctl_tcp_fack, |
| 455 | .maxlen = sizeof(int), |
| 456 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 457 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 458 | }, |
| 459 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 460 | .procname = "tcp_reordering", |
| 461 | .data = &sysctl_tcp_reordering, |
| 462 | .maxlen = sizeof(int), |
| 463 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 464 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 465 | }, |
| 466 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 467 | .procname = "tcp_ecn", |
| 468 | .data = &sysctl_tcp_ecn, |
| 469 | .maxlen = sizeof(int), |
| 470 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 471 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 472 | }, |
| 473 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 474 | .procname = "tcp_dsack", |
| 475 | .data = &sysctl_tcp_dsack, |
| 476 | .maxlen = sizeof(int), |
| 477 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 478 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 479 | }, |
| 480 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 481 | .procname = "tcp_wmem", |
| 482 | .data = &sysctl_tcp_wmem, |
| 483 | .maxlen = sizeof(sysctl_tcp_wmem), |
| 484 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 485 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 486 | }, |
| 487 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 488 | .procname = "tcp_rmem", |
| 489 | .data = &sysctl_tcp_rmem, |
| 490 | .maxlen = sizeof(sysctl_tcp_rmem), |
| 491 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 492 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 493 | }, |
| 494 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 495 | .procname = "tcp_app_win", |
| 496 | .data = &sysctl_tcp_app_win, |
| 497 | .maxlen = sizeof(int), |
| 498 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 499 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 500 | }, |
| 501 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 502 | .procname = "tcp_adv_win_scale", |
| 503 | .data = &sysctl_tcp_adv_win_scale, |
| 504 | .maxlen = sizeof(int), |
| 505 | .mode = 0644, |
Alexey Dobriyan | 0147fc0 | 2010-11-22 12:54:21 +0000 | [diff] [blame] | 506 | .proc_handler = proc_dointvec_minmax, |
| 507 | .extra1 = &tcp_adv_win_scale_min, |
| 508 | .extra2 = &tcp_adv_win_scale_max, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 509 | }, |
| 510 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 511 | .procname = "tcp_tw_reuse", |
| 512 | .data = &sysctl_tcp_tw_reuse, |
| 513 | .maxlen = sizeof(int), |
| 514 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 515 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 516 | }, |
| 517 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 518 | .procname = "tcp_frto", |
| 519 | .data = &sysctl_tcp_frto, |
| 520 | .maxlen = sizeof(int), |
| 521 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 522 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 523 | }, |
| 524 | { |
Ilpo Järvinen | 3cfe3ba | 2007-02-27 10:09:49 -0800 | [diff] [blame] | 525 | .procname = "tcp_frto_response", |
| 526 | .data = &sysctl_tcp_frto_response, |
| 527 | .maxlen = sizeof(int), |
| 528 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 529 | .proc_handler = proc_dointvec |
Ilpo Järvinen | 3cfe3ba | 2007-02-27 10:09:49 -0800 | [diff] [blame] | 530 | }, |
| 531 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 532 | .procname = "tcp_low_latency", |
| 533 | .data = &sysctl_tcp_low_latency, |
| 534 | .maxlen = sizeof(int), |
| 535 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 536 | .proc_handler = proc_dointvec |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 537 | }, |
| 538 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 539 | .procname = "tcp_no_metrics_save", |
| 540 | .data = &sysctl_tcp_nometrics_save, |
| 541 | .maxlen = sizeof(int), |
| 542 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 543 | .proc_handler = proc_dointvec, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 544 | }, |
| 545 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 546 | .procname = "tcp_moderate_rcvbuf", |
| 547 | .data = &sysctl_tcp_moderate_rcvbuf, |
| 548 | .maxlen = sizeof(int), |
| 549 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 550 | .proc_handler = proc_dointvec, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 551 | }, |
| 552 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 553 | .procname = "tcp_tso_win_divisor", |
| 554 | .data = &sysctl_tcp_tso_win_divisor, |
| 555 | .maxlen = sizeof(int), |
| 556 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 557 | .proc_handler = proc_dointvec, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 558 | }, |
| 559 | { |
Stephen Hemminger | 317a76f | 2005-06-23 12:19:55 -0700 | [diff] [blame] | 560 | .procname = "tcp_congestion_control", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 561 | .mode = 0644, |
Stephen Hemminger | 317a76f | 2005-06-23 12:19:55 -0700 | [diff] [blame] | 562 | .maxlen = TCP_CA_NAME_MAX, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 563 | .proc_handler = proc_tcp_congestion_control, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 564 | }, |
Stephen Hemminger | 9772efb | 2005-11-10 17:09:53 -0800 | [diff] [blame] | 565 | { |
Stephen Hemminger | 9772efb | 2005-11-10 17:09:53 -0800 | [diff] [blame] | 566 | .procname = "tcp_abc", |
| 567 | .data = &sysctl_tcp_abc, |
| 568 | .maxlen = sizeof(int), |
| 569 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 570 | .proc_handler = proc_dointvec, |
Stephen Hemminger | 9772efb | 2005-11-10 17:09:53 -0800 | [diff] [blame] | 571 | }, |
John Heffner | 5d424d5 | 2006-03-20 17:53:41 -0800 | [diff] [blame] | 572 | { |
John Heffner | 5d424d5 | 2006-03-20 17:53:41 -0800 | [diff] [blame] | 573 | .procname = "tcp_mtu_probing", |
| 574 | .data = &sysctl_tcp_mtu_probing, |
| 575 | .maxlen = sizeof(int), |
| 576 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 577 | .proc_handler = proc_dointvec, |
John Heffner | 5d424d5 | 2006-03-20 17:53:41 -0800 | [diff] [blame] | 578 | }, |
| 579 | { |
John Heffner | 5d424d5 | 2006-03-20 17:53:41 -0800 | [diff] [blame] | 580 | .procname = "tcp_base_mss", |
| 581 | .data = &sysctl_tcp_base_mss, |
| 582 | .maxlen = sizeof(int), |
| 583 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 584 | .proc_handler = proc_dointvec, |
John Heffner | 5d424d5 | 2006-03-20 17:53:41 -0800 | [diff] [blame] | 585 | }, |
YOSHIFUJI Hideaki | e905a9e | 2007-02-09 23:24:47 +0900 | [diff] [blame] | 586 | { |
Rick Jones | 15d99e0 | 2006-03-20 22:40:29 -0800 | [diff] [blame] | 587 | .procname = "tcp_workaround_signed_windows", |
| 588 | .data = &sysctl_tcp_workaround_signed_windows, |
| 589 | .maxlen = sizeof(int), |
| 590 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 591 | .proc_handler = proc_dointvec |
Rick Jones | 15d99e0 | 2006-03-20 22:40:29 -0800 | [diff] [blame] | 592 | }, |
Chris Leech | 9593782 | 2006-05-23 18:02:55 -0700 | [diff] [blame] | 593 | #ifdef CONFIG_NET_DMA |
| 594 | { |
Chris Leech | 9593782 | 2006-05-23 18:02:55 -0700 | [diff] [blame] | 595 | .procname = "tcp_dma_copybreak", |
| 596 | .data = &sysctl_tcp_dma_copybreak, |
| 597 | .maxlen = sizeof(int), |
| 598 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 599 | .proc_handler = proc_dointvec |
Chris Leech | 9593782 | 2006-05-23 18:02:55 -0700 | [diff] [blame] | 600 | }, |
| 601 | #endif |
David S. Miller | 35089bb | 2006-06-13 22:33:04 -0700 | [diff] [blame] | 602 | { |
David S. Miller | 35089bb | 2006-06-13 22:33:04 -0700 | [diff] [blame] | 603 | .procname = "tcp_slow_start_after_idle", |
| 604 | .data = &sysctl_tcp_slow_start_after_idle, |
| 605 | .maxlen = sizeof(int), |
| 606 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 607 | .proc_handler = proc_dointvec |
David S. Miller | 35089bb | 2006-06-13 22:33:04 -0700 | [diff] [blame] | 608 | }, |
Paul Moore | 446fda4 | 2006-08-03 16:48:06 -0700 | [diff] [blame] | 609 | #ifdef CONFIG_NETLABEL |
| 610 | { |
Paul Moore | 446fda4 | 2006-08-03 16:48:06 -0700 | [diff] [blame] | 611 | .procname = "cipso_cache_enable", |
| 612 | .data = &cipso_v4_cache_enabled, |
| 613 | .maxlen = sizeof(int), |
| 614 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 615 | .proc_handler = proc_dointvec, |
Paul Moore | 446fda4 | 2006-08-03 16:48:06 -0700 | [diff] [blame] | 616 | }, |
| 617 | { |
Paul Moore | 446fda4 | 2006-08-03 16:48:06 -0700 | [diff] [blame] | 618 | .procname = "cipso_cache_bucket_size", |
| 619 | .data = &cipso_v4_cache_bucketsize, |
| 620 | .maxlen = sizeof(int), |
| 621 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 622 | .proc_handler = proc_dointvec, |
Paul Moore | 446fda4 | 2006-08-03 16:48:06 -0700 | [diff] [blame] | 623 | }, |
| 624 | { |
Paul Moore | 446fda4 | 2006-08-03 16:48:06 -0700 | [diff] [blame] | 625 | .procname = "cipso_rbm_optfmt", |
| 626 | .data = &cipso_v4_rbm_optfmt, |
| 627 | .maxlen = sizeof(int), |
| 628 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 629 | .proc_handler = proc_dointvec, |
Paul Moore | 446fda4 | 2006-08-03 16:48:06 -0700 | [diff] [blame] | 630 | }, |
| 631 | { |
Paul Moore | 446fda4 | 2006-08-03 16:48:06 -0700 | [diff] [blame] | 632 | .procname = "cipso_rbm_strictvalid", |
| 633 | .data = &cipso_v4_rbm_strictvalid, |
| 634 | .maxlen = sizeof(int), |
| 635 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 636 | .proc_handler = proc_dointvec, |
Paul Moore | 446fda4 | 2006-08-03 16:48:06 -0700 | [diff] [blame] | 637 | }, |
| 638 | #endif /* CONFIG_NETLABEL */ |
Stephen Hemminger | 3ff825b | 2006-11-09 16:32:06 -0800 | [diff] [blame] | 639 | { |
Stephen Hemminger | 3ff825b | 2006-11-09 16:32:06 -0800 | [diff] [blame] | 640 | .procname = "tcp_available_congestion_control", |
| 641 | .maxlen = TCP_CA_BUF_MAX, |
| 642 | .mode = 0444, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 643 | .proc_handler = proc_tcp_available_congestion_control, |
Stephen Hemminger | 3ff825b | 2006-11-09 16:32:06 -0800 | [diff] [blame] | 644 | }, |
Stephen Hemminger | ce7bc3b | 2006-11-09 16:35:15 -0800 | [diff] [blame] | 645 | { |
Stephen Hemminger | ce7bc3b | 2006-11-09 16:35:15 -0800 | [diff] [blame] | 646 | .procname = "tcp_allowed_congestion_control", |
| 647 | .maxlen = TCP_CA_BUF_MAX, |
| 648 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 649 | .proc_handler = proc_allowed_congestion_control, |
Stephen Hemminger | ce7bc3b | 2006-11-09 16:35:15 -0800 | [diff] [blame] | 650 | }, |
John Heffner | 886236c | 2007-03-25 19:21:45 -0700 | [diff] [blame] | 651 | { |
John Heffner | 886236c | 2007-03-25 19:21:45 -0700 | [diff] [blame] | 652 | .procname = "tcp_max_ssthresh", |
| 653 | .data = &sysctl_tcp_max_ssthresh, |
| 654 | .maxlen = sizeof(int), |
| 655 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 656 | .proc_handler = proc_dointvec, |
John Heffner | 886236c | 2007-03-25 19:21:45 -0700 | [diff] [blame] | 657 | }, |
Hideo Aoki | 95766ff | 2007-12-31 00:29:24 -0800 | [diff] [blame] | 658 | { |
William Allen Simpson | 519855c | 2009-12-02 18:14:19 +0000 | [diff] [blame] | 659 | .procname = "tcp_cookie_size", |
| 660 | .data = &sysctl_tcp_cookie_size, |
| 661 | .maxlen = sizeof(int), |
| 662 | .mode = 0644, |
| 663 | .proc_handler = proc_dointvec |
| 664 | }, |
| 665 | { |
Andreas Petlund | 36e31b0a | 2010-02-18 02:47:01 +0000 | [diff] [blame] | 666 | .procname = "tcp_thin_linear_timeouts", |
| 667 | .data = &sysctl_tcp_thin_linear_timeouts, |
| 668 | .maxlen = sizeof(int), |
| 669 | .mode = 0644, |
| 670 | .proc_handler = proc_dointvec |
| 671 | }, |
Andreas Petlund | 7e38017 | 2010-02-18 04:48:19 +0000 | [diff] [blame] | 672 | { |
| 673 | .procname = "tcp_thin_dupack", |
| 674 | .data = &sysctl_tcp_thin_dupack, |
| 675 | .maxlen = sizeof(int), |
| 676 | .mode = 0644, |
| 677 | .proc_handler = proc_dointvec |
| 678 | }, |
Andreas Petlund | 36e31b0a | 2010-02-18 02:47:01 +0000 | [diff] [blame] | 679 | { |
Hideo Aoki | 95766ff | 2007-12-31 00:29:24 -0800 | [diff] [blame] | 680 | .procname = "udp_mem", |
| 681 | .data = &sysctl_udp_mem, |
| 682 | .maxlen = sizeof(sysctl_udp_mem), |
| 683 | .mode = 0644, |
Eric Dumazet | 8d987e5 | 2010-11-09 23:24:26 +0000 | [diff] [blame] | 684 | .proc_handler = proc_doulongvec_minmax, |
Hideo Aoki | 95766ff | 2007-12-31 00:29:24 -0800 | [diff] [blame] | 685 | }, |
| 686 | { |
Hideo Aoki | 95766ff | 2007-12-31 00:29:24 -0800 | [diff] [blame] | 687 | .procname = "udp_rmem_min", |
| 688 | .data = &sysctl_udp_rmem_min, |
| 689 | .maxlen = sizeof(sysctl_udp_rmem_min), |
| 690 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 691 | .proc_handler = proc_dointvec_minmax, |
Hideo Aoki | 95766ff | 2007-12-31 00:29:24 -0800 | [diff] [blame] | 692 | .extra1 = &zero |
| 693 | }, |
| 694 | { |
Hideo Aoki | 95766ff | 2007-12-31 00:29:24 -0800 | [diff] [blame] | 695 | .procname = "udp_wmem_min", |
| 696 | .data = &sysctl_udp_wmem_min, |
| 697 | .maxlen = sizeof(sysctl_udp_wmem_min), |
| 698 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 699 | .proc_handler = proc_dointvec_minmax, |
Hideo Aoki | 95766ff | 2007-12-31 00:29:24 -0800 | [diff] [blame] | 700 | .extra1 = &zero |
| 701 | }, |
Eric W. Biederman | f8572d8 | 2009-11-05 13:32:03 -0800 | [diff] [blame] | 702 | { } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 703 | }; |
Pavel Emelyanov | 3e37c3f | 2007-12-05 01:41:26 -0800 | [diff] [blame] | 704 | |
Pavel Emelyanov | 68528f0 | 2008-03-26 01:56:24 -0700 | [diff] [blame] | 705 | static struct ctl_table ipv4_net_table[] = { |
| 706 | { |
Pavel Emelyanov | 68528f0 | 2008-03-26 01:56:24 -0700 | [diff] [blame] | 707 | .procname = "icmp_echo_ignore_all", |
| 708 | .data = &init_net.ipv4.sysctl_icmp_echo_ignore_all, |
| 709 | .maxlen = sizeof(int), |
| 710 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 711 | .proc_handler = proc_dointvec |
Pavel Emelyanov | 68528f0 | 2008-03-26 01:56:24 -0700 | [diff] [blame] | 712 | }, |
| 713 | { |
Pavel Emelyanov | 68528f0 | 2008-03-26 01:56:24 -0700 | [diff] [blame] | 714 | .procname = "icmp_echo_ignore_broadcasts", |
| 715 | .data = &init_net.ipv4.sysctl_icmp_echo_ignore_broadcasts, |
| 716 | .maxlen = sizeof(int), |
| 717 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 718 | .proc_handler = proc_dointvec |
Pavel Emelyanov | 68528f0 | 2008-03-26 01:56:24 -0700 | [diff] [blame] | 719 | }, |
| 720 | { |
Pavel Emelyanov | 68528f0 | 2008-03-26 01:56:24 -0700 | [diff] [blame] | 721 | .procname = "icmp_ignore_bogus_error_responses", |
| 722 | .data = &init_net.ipv4.sysctl_icmp_ignore_bogus_error_responses, |
| 723 | .maxlen = sizeof(int), |
| 724 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 725 | .proc_handler = proc_dointvec |
Pavel Emelyanov | 68528f0 | 2008-03-26 01:56:24 -0700 | [diff] [blame] | 726 | }, |
| 727 | { |
Pavel Emelyanov | 68528f0 | 2008-03-26 01:56:24 -0700 | [diff] [blame] | 728 | .procname = "icmp_errors_use_inbound_ifaddr", |
| 729 | .data = &init_net.ipv4.sysctl_icmp_errors_use_inbound_ifaddr, |
| 730 | .maxlen = sizeof(int), |
| 731 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 732 | .proc_handler = proc_dointvec |
Pavel Emelyanov | 68528f0 | 2008-03-26 01:56:24 -0700 | [diff] [blame] | 733 | }, |
| 734 | { |
Pavel Emelyanov | 68528f0 | 2008-03-26 01:56:24 -0700 | [diff] [blame] | 735 | .procname = "icmp_ratelimit", |
| 736 | .data = &init_net.ipv4.sysctl_icmp_ratelimit, |
| 737 | .maxlen = sizeof(int), |
| 738 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 739 | .proc_handler = proc_dointvec_ms_jiffies, |
Pavel Emelyanov | 68528f0 | 2008-03-26 01:56:24 -0700 | [diff] [blame] | 740 | }, |
| 741 | { |
Pavel Emelyanov | 68528f0 | 2008-03-26 01:56:24 -0700 | [diff] [blame] | 742 | .procname = "icmp_ratemask", |
| 743 | .data = &init_net.ipv4.sysctl_icmp_ratemask, |
| 744 | .maxlen = sizeof(int), |
| 745 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 746 | .proc_handler = proc_dointvec |
Pavel Emelyanov | 68528f0 | 2008-03-26 01:56:24 -0700 | [diff] [blame] | 747 | }, |
Neil Horman | 1080d70 | 2008-10-27 12:28:25 -0700 | [diff] [blame] | 748 | { |
Neil Horman | 1080d70 | 2008-10-27 12:28:25 -0700 | [diff] [blame] | 749 | .procname = "rt_cache_rebuild_count", |
| 750 | .data = &init_net.ipv4.sysctl_rt_cache_rebuild_count, |
| 751 | .maxlen = sizeof(int), |
| 752 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 753 | .proc_handler = proc_dointvec |
Neil Horman | 1080d70 | 2008-10-27 12:28:25 -0700 | [diff] [blame] | 754 | }, |
Vasiliy Kulikov | c319b4d | 2011-05-13 10:01:00 +0000 | [diff] [blame] | 755 | { |
| 756 | .procname = "ping_group_range", |
| 757 | .data = &init_net.ipv4.sysctl_ping_group_range, |
| 758 | .maxlen = sizeof(init_net.ipv4.sysctl_ping_group_range), |
| 759 | .mode = 0644, |
| 760 | .proc_handler = ipv4_ping_group_range, |
| 761 | }, |
Glauber Costa | 3dc43e3 | 2011-12-11 21:47:05 +0000 | [diff] [blame] | 762 | { |
| 763 | .procname = "tcp_mem", |
| 764 | .maxlen = sizeof(init_net.ipv4.sysctl_tcp_mem), |
| 765 | .mode = 0644, |
| 766 | .proc_handler = ipv4_tcp_mem, |
| 767 | }, |
Pavel Emelyanov | 68528f0 | 2008-03-26 01:56:24 -0700 | [diff] [blame] | 768 | { } |
| 769 | }; |
| 770 | |
Pavel Emelyanov | 3d7cc2b | 2008-01-09 00:33:11 -0800 | [diff] [blame] | 771 | struct ctl_path net_ipv4_ctl_path[] = { |
Eric W. Biederman | f8572d8 | 2009-11-05 13:32:03 -0800 | [diff] [blame] | 772 | { .procname = "net", }, |
| 773 | { .procname = "ipv4", }, |
Pavel Emelyanov | 3e37c3f | 2007-12-05 01:41:26 -0800 | [diff] [blame] | 774 | { }, |
| 775 | }; |
Pavel Emelyanov | 3d7cc2b | 2008-01-09 00:33:11 -0800 | [diff] [blame] | 776 | EXPORT_SYMBOL_GPL(net_ipv4_ctl_path); |
Pavel Emelyanov | 3e37c3f | 2007-12-05 01:41:26 -0800 | [diff] [blame] | 777 | |
Pavel Emelyanov | 1577519 | 2008-03-26 01:54:18 -0700 | [diff] [blame] | 778 | static __net_init int ipv4_sysctl_init_net(struct net *net) |
| 779 | { |
Pavel Emelyanov | 68528f0 | 2008-03-26 01:56:24 -0700 | [diff] [blame] | 780 | struct ctl_table *table; |
Glauber Costa | 3dc43e3 | 2011-12-11 21:47:05 +0000 | [diff] [blame] | 781 | unsigned long limit; |
Pavel Emelyanov | 68528f0 | 2008-03-26 01:56:24 -0700 | [diff] [blame] | 782 | |
| 783 | table = ipv4_net_table; |
Octavian Purdila | 09ad9bc | 2009-11-25 15:14:13 -0800 | [diff] [blame] | 784 | if (!net_eq(net, &init_net)) { |
Pavel Emelyanov | 68528f0 | 2008-03-26 01:56:24 -0700 | [diff] [blame] | 785 | table = kmemdup(table, sizeof(ipv4_net_table), GFP_KERNEL); |
| 786 | if (table == NULL) |
| 787 | goto err_alloc; |
| 788 | |
| 789 | table[0].data = |
| 790 | &net->ipv4.sysctl_icmp_echo_ignore_all; |
| 791 | table[1].data = |
| 792 | &net->ipv4.sysctl_icmp_echo_ignore_broadcasts; |
| 793 | table[2].data = |
| 794 | &net->ipv4.sysctl_icmp_ignore_bogus_error_responses; |
| 795 | table[3].data = |
| 796 | &net->ipv4.sysctl_icmp_errors_use_inbound_ifaddr; |
| 797 | table[4].data = |
| 798 | &net->ipv4.sysctl_icmp_ratelimit; |
| 799 | table[5].data = |
| 800 | &net->ipv4.sysctl_icmp_ratemask; |
Neil Horman | 1080d70 | 2008-10-27 12:28:25 -0700 | [diff] [blame] | 801 | table[6].data = |
| 802 | &net->ipv4.sysctl_rt_cache_rebuild_count; |
Vasiliy Kulikov | c319b4d | 2011-05-13 10:01:00 +0000 | [diff] [blame] | 803 | table[7].data = |
| 804 | &net->ipv4.sysctl_ping_group_range; |
| 805 | |
Pavel Emelyanov | 68528f0 | 2008-03-26 01:56:24 -0700 | [diff] [blame] | 806 | } |
| 807 | |
Vasiliy Kulikov | c319b4d | 2011-05-13 10:01:00 +0000 | [diff] [blame] | 808 | /* |
| 809 | * Sane defaults - nobody may create ping sockets. |
| 810 | * Boot scripts should set this to distro-specific group. |
| 811 | */ |
| 812 | net->ipv4.sysctl_ping_group_range[0] = 1; |
| 813 | net->ipv4.sysctl_ping_group_range[1] = 0; |
| 814 | |
Neil Horman | 1080d70 | 2008-10-27 12:28:25 -0700 | [diff] [blame] | 815 | net->ipv4.sysctl_rt_cache_rebuild_count = 4; |
| 816 | |
Glauber Costa | 4acb419 | 2012-01-30 01:20:17 +0000 | [diff] [blame] | 817 | tcp_init_mem(net); |
Glauber Costa | 3dc43e3 | 2011-12-11 21:47:05 +0000 | [diff] [blame] | 818 | limit = nr_free_buffer_pages() / 8; |
| 819 | limit = max(limit, 128UL); |
| 820 | net->ipv4.sysctl_tcp_mem[0] = limit / 4 * 3; |
| 821 | net->ipv4.sysctl_tcp_mem[1] = limit; |
| 822 | net->ipv4.sysctl_tcp_mem[2] = net->ipv4.sysctl_tcp_mem[0] * 2; |
| 823 | |
Pavel Emelyanov | 68528f0 | 2008-03-26 01:56:24 -0700 | [diff] [blame] | 824 | net->ipv4.ipv4_hdr = register_net_sysctl_table(net, |
| 825 | net_ipv4_ctl_path, table); |
| 826 | if (net->ipv4.ipv4_hdr == NULL) |
| 827 | goto err_reg; |
| 828 | |
Pavel Emelyanov | 1577519 | 2008-03-26 01:54:18 -0700 | [diff] [blame] | 829 | return 0; |
Pavel Emelyanov | 68528f0 | 2008-03-26 01:56:24 -0700 | [diff] [blame] | 830 | |
| 831 | err_reg: |
Octavian Purdila | 09ad9bc | 2009-11-25 15:14:13 -0800 | [diff] [blame] | 832 | if (!net_eq(net, &init_net)) |
Pavel Emelyanov | 68528f0 | 2008-03-26 01:56:24 -0700 | [diff] [blame] | 833 | kfree(table); |
| 834 | err_alloc: |
| 835 | return -ENOMEM; |
Pavel Emelyanov | 1577519 | 2008-03-26 01:54:18 -0700 | [diff] [blame] | 836 | } |
| 837 | |
| 838 | static __net_exit void ipv4_sysctl_exit_net(struct net *net) |
| 839 | { |
Pavel Emelyanov | 68528f0 | 2008-03-26 01:56:24 -0700 | [diff] [blame] | 840 | struct ctl_table *table; |
| 841 | |
| 842 | table = net->ipv4.ipv4_hdr->ctl_table_arg; |
| 843 | unregister_net_sysctl_table(net->ipv4.ipv4_hdr); |
| 844 | kfree(table); |
Pavel Emelyanov | 1577519 | 2008-03-26 01:54:18 -0700 | [diff] [blame] | 845 | } |
| 846 | |
| 847 | static __net_initdata struct pernet_operations ipv4_sysctl_ops = { |
| 848 | .init = ipv4_sysctl_init_net, |
| 849 | .exit = ipv4_sysctl_exit_net, |
| 850 | }; |
| 851 | |
Pavel Emelyanov | 3e37c3f | 2007-12-05 01:41:26 -0800 | [diff] [blame] | 852 | static __init int sysctl_ipv4_init(void) |
| 853 | { |
| 854 | struct ctl_table_header *hdr; |
Amerigo Wang | e3826f1 | 2010-05-05 00:27:06 +0000 | [diff] [blame] | 855 | struct ctl_table *i; |
| 856 | |
| 857 | for (i = ipv4_table; i->procname; i++) { |
| 858 | if (strcmp(i->procname, "ip_local_reserved_ports") == 0) { |
| 859 | i->data = sysctl_local_reserved_ports; |
| 860 | break; |
| 861 | } |
| 862 | } |
| 863 | if (!i->procname) |
| 864 | return -EINVAL; |
Pavel Emelyanov | 3e37c3f | 2007-12-05 01:41:26 -0800 | [diff] [blame] | 865 | |
Pavel Emelyanov | 3d7cc2b | 2008-01-09 00:33:11 -0800 | [diff] [blame] | 866 | hdr = register_sysctl_paths(net_ipv4_ctl_path, ipv4_table); |
Pavel Emelyanov | 1577519 | 2008-03-26 01:54:18 -0700 | [diff] [blame] | 867 | if (hdr == NULL) |
| 868 | return -ENOMEM; |
| 869 | |
| 870 | if (register_pernet_subsys(&ipv4_sysctl_ops)) { |
| 871 | unregister_sysctl_table(hdr); |
| 872 | return -ENOMEM; |
| 873 | } |
| 874 | |
| 875 | return 0; |
Pavel Emelyanov | 3e37c3f | 2007-12-05 01:41:26 -0800 | [diff] [blame] | 876 | } |
| 877 | |
| 878 | __initcall(sysctl_ipv4_init); |