aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-08 10:38:50 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-08 10:38:50 -0500
commit1557d33007f63dd96e5d15f33af389378e5f2e54 (patch)
tree06d05722b2ba5d2a67532f779fa8a88efe3c88f1 /net/ipv4
parent6ec22f9b037fc0c2e00ddb7023fad279c365324d (diff)
parentc656ae95d1c5c8ed5763356263ace2d03087efec (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/sysctl-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/sysctl-2.6: (43 commits) security/tomoyo: Remove now unnecessary handling of security_sysctl. security/tomoyo: Add a special case to handle accesses through the internal proc mount. sysctl: Drop & in front of every proc_handler. sysctl: Remove CTL_NONE and CTL_UNNUMBERED sysctl: kill dead ctl_handler definitions. sysctl: Remove the last of the generic binary sysctl support sysctl net: Remove unused binary sysctl code sysctl security/tomoyo: Don't look at ctl_name sysctl arm: Remove binary sysctl support sysctl x86: Remove dead binary sysctl support sysctl sh: Remove dead binary sysctl support sysctl powerpc: Remove dead binary sysctl support sysctl ia64: Remove dead binary sysctl support sysctl s390: Remove dead sysctl binary support sysctl frv: Remove dead binary sysctl support sysctl mips/lasat: Remove dead binary sysctl support sysctl drivers: Remove dead binary sysctl support sysctl crypto: Remove dead binary sysctl support sysctl security/keys: Remove dead binary sysctl support sysctl kernel: Remove binary sysctl logic ...
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/arp.c2
-rw-r--r--net/ipv4/devinet.c111
-rw-r--r--net/ipv4/ip_fragment.c6
-rw-r--r--net/ipv4/netfilter.c6
-rw-r--r--net/ipv4/netfilter/ip_queue.c3
-rw-r--r--net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c10
-rw-r--r--net/ipv4/netfilter/nf_conntrack_proto_icmp.c8
-rw-r--r--net/ipv4/route.c73
-rw-r--r--net/ipv4/sysctl_net_ipv4.c164
-rw-r--r--net/ipv4/xfrm4_policy.c1
10 files changed, 37 insertions, 347 deletions
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 4e80f336c0cf..c95cd93acf29 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -1240,7 +1240,7 @@ void __init arp_init(void)
1240 arp_proc_init(); 1240 arp_proc_init();
1241#ifdef CONFIG_SYSCTL 1241#ifdef CONFIG_SYSCTL
1242 neigh_sysctl_register(NULL, &arp_tbl.parms, NET_IPV4, 1242 neigh_sysctl_register(NULL, &arp_tbl.parms, NET_IPV4,
1243 NET_IPV4_NEIGH, "ipv4", NULL, NULL); 1243 NET_IPV4_NEIGH, "ipv4", NULL);
1244#endif 1244#endif
1245 register_netdevice_notifier(&arp_netdev_notifier); 1245 register_netdevice_notifier(&arp_netdev_notifier);
1246} 1246}
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 5df2f6a0b0f0..e049da8311b5 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1293,58 +1293,6 @@ static int devinet_conf_proc(ctl_table *ctl, int write,
1293 return ret; 1293 return ret;
1294} 1294}
1295 1295
1296static int devinet_conf_sysctl(ctl_table *table,
1297 void __user *oldval, size_t __user *oldlenp,
1298 void __user *newval, size_t newlen)
1299{
1300 struct ipv4_devconf *cnf;
1301 struct net *net;
1302 int *valp = table->data;
1303 int new;
1304 int i;
1305
1306 if (!newval || !newlen)
1307 return 0;
1308
1309 if (newlen != sizeof(int))
1310 return -EINVAL;
1311
1312 if (get_user(new, (int __user *)newval))
1313 return -EFAULT;
1314
1315 if (new == *valp)
1316 return 0;
1317
1318 if (oldval && oldlenp) {
1319 size_t len;
1320
1321 if (get_user(len, oldlenp))
1322 return -EFAULT;
1323
1324 if (len) {
1325 if (len > table->maxlen)
1326 len = table->maxlen;
1327 if (copy_to_user(oldval, valp, len))
1328 return -EFAULT;
1329 if (put_user(len, oldlenp))
1330 return -EFAULT;
1331 }
1332 }
1333
1334 *valp = new;
1335
1336 cnf = table->extra1;
1337 net = table->extra2;
1338 i = (int *)table->data - cnf->data;
1339
1340 set_bit(i, cnf->state);
1341
1342 if (cnf == net->ipv4.devconf_dflt)
1343 devinet_copy_dflt_conf(net, i);
1344
1345 return 1;
1346}
1347
1348static int devinet_sysctl_forward(ctl_table *ctl, int write, 1296static int devinet_sysctl_forward(ctl_table *ctl, int write,
1349 void __user *buffer, 1297 void __user *buffer,
1350 size_t *lenp, loff_t *ppos) 1298 size_t *lenp, loff_t *ppos)
@@ -1390,47 +1338,28 @@ int ipv4_doint_and_flush(ctl_table *ctl, int write,
1390 return ret; 1338 return ret;
1391} 1339}
1392 1340
1393int ipv4_doint_and_flush_strategy(ctl_table *table, 1341#define DEVINET_SYSCTL_ENTRY(attr, name, mval, proc) \
1394 void __user *oldval, size_t __user *oldlenp,
1395 void __user *newval, size_t newlen)
1396{
1397 int ret = devinet_conf_sysctl(table, oldval, oldlenp, newval, newlen);
1398 struct net *net = table->extra2;
1399
1400 if (ret == 1)
1401 rt_cache_flush(net, 0);
1402
1403 return ret;
1404}
1405
1406
1407#define DEVINET_SYSCTL_ENTRY(attr, name, mval, proc, sysctl) \
1408 { \ 1342 { \
1409 .ctl_name = NET_IPV4_CONF_ ## attr, \
1410 .procname = name, \ 1343 .procname = name, \
1411 .data = ipv4_devconf.data + \ 1344 .data = ipv4_devconf.data + \
1412 NET_IPV4_CONF_ ## attr - 1, \ 1345 NET_IPV4_CONF_ ## attr - 1, \
1413 .maxlen = sizeof(int), \ 1346 .maxlen = sizeof(int), \
1414 .mode = mval, \ 1347 .mode = mval, \
1415 .proc_handler = proc, \ 1348 .proc_handler = proc, \
1416 .strategy = sysctl, \
1417 .extra1 = &ipv4_devconf, \ 1349 .extra1 = &ipv4_devconf, \
1418 } 1350 }
1419 1351
1420#define DEVINET_SYSCTL_RW_ENTRY(attr, name) \ 1352#define DEVINET_SYSCTL_RW_ENTRY(attr, name) \
1421 DEVINET_SYSCTL_ENTRY(attr, name, 0644, devinet_conf_proc, \ 1353 DEVINET_SYSCTL_ENTRY(attr, name, 0644, devinet_conf_proc)
1422 devinet_conf_sysctl)
1423 1354
1424#define DEVINET_SYSCTL_RO_ENTRY(attr, name) \ 1355#define DEVINET_SYSCTL_RO_ENTRY(attr, name) \
1425 DEVINET_SYSCTL_ENTRY(attr, name, 0444, devinet_conf_proc, \ 1356 DEVINET_SYSCTL_ENTRY(attr, name, 0444, devinet_conf_proc)
1426 devinet_conf_sysctl)
1427 1357
1428#define DEVINET_SYSCTL_COMPLEX_ENTRY(attr, name, proc, sysctl) \ 1358#define DEVINET_SYSCTL_COMPLEX_ENTRY(attr, name, proc) \
1429 DEVINET_SYSCTL_ENTRY(attr, name, 0644, proc, sysctl) 1359 DEVINET_SYSCTL_ENTRY(attr, name, 0644, proc)
1430 1360
1431#define DEVINET_SYSCTL_FLUSHING_ENTRY(attr, name) \ 1361#define DEVINET_SYSCTL_FLUSHING_ENTRY(attr, name) \
1432 DEVINET_SYSCTL_COMPLEX_ENTRY(attr, name, ipv4_doint_and_flush, \ 1362 DEVINET_SYSCTL_COMPLEX_ENTRY(attr, name, ipv4_doint_and_flush)
1433 ipv4_doint_and_flush_strategy)
1434 1363
1435static struct devinet_sysctl_table { 1364static struct devinet_sysctl_table {
1436 struct ctl_table_header *sysctl_header; 1365 struct ctl_table_header *sysctl_header;
@@ -1439,8 +1368,7 @@ static struct devinet_sysctl_table {
1439} devinet_sysctl = { 1368} devinet_sysctl = {
1440 .devinet_vars = { 1369 .devinet_vars = {
1441 DEVINET_SYSCTL_COMPLEX_ENTRY(FORWARDING, "forwarding", 1370 DEVINET_SYSCTL_COMPLEX_ENTRY(FORWARDING, "forwarding",
1442 devinet_sysctl_forward, 1371 devinet_sysctl_forward),
1443 devinet_conf_sysctl),
1444 DEVINET_SYSCTL_RO_ENTRY(MC_FORWARDING, "mc_forwarding"), 1372 DEVINET_SYSCTL_RO_ENTRY(MC_FORWARDING, "mc_forwarding"),
1445 1373
1446 DEVINET_SYSCTL_RW_ENTRY(ACCEPT_REDIRECTS, "accept_redirects"), 1374 DEVINET_SYSCTL_RW_ENTRY(ACCEPT_REDIRECTS, "accept_redirects"),
@@ -1471,7 +1399,7 @@ static struct devinet_sysctl_table {
1471}; 1399};
1472 1400
1473static int __devinet_sysctl_register(struct net *net, char *dev_name, 1401static int __devinet_sysctl_register(struct net *net, char *dev_name,
1474 int ctl_name, struct ipv4_devconf *p) 1402 struct ipv4_devconf *p)
1475{ 1403{
1476 int i; 1404 int i;
1477 struct devinet_sysctl_table *t; 1405 struct devinet_sysctl_table *t;
@@ -1479,9 +1407,9 @@ static int __devinet_sysctl_register(struct net *net, char *dev_name,
1479#define DEVINET_CTL_PATH_DEV 3 1407#define DEVINET_CTL_PATH_DEV 3
1480 1408
1481 struct ctl_path devinet_ctl_path[] = { 1409 struct ctl_path devinet_ctl_path[] = {
1482 { .procname = "net", .ctl_name = CTL_NET, }, 1410 { .procname = "net", },
1483 { .procname = "ipv4", .ctl_name = NET_IPV4, }, 1411 { .procname = "ipv4", },
1484 { .procname = "conf", .ctl_name = NET_IPV4_CONF, }, 1412 { .procname = "conf", },
1485 { /* to be set */ }, 1413 { /* to be set */ },
1486 { }, 1414 { },
1487 }; 1415 };
@@ -1506,7 +1434,6 @@ static int __devinet_sysctl_register(struct net *net, char *dev_name,
1506 goto free; 1434 goto free;
1507 1435
1508 devinet_ctl_path[DEVINET_CTL_PATH_DEV].procname = t->dev_name; 1436 devinet_ctl_path[DEVINET_CTL_PATH_DEV].procname = t->dev_name;
1509 devinet_ctl_path[DEVINET_CTL_PATH_DEV].ctl_name = ctl_name;
1510 1437
1511 t->sysctl_header = register_net_sysctl_table(net, devinet_ctl_path, 1438 t->sysctl_header = register_net_sysctl_table(net, devinet_ctl_path,
1512 t->devinet_vars); 1439 t->devinet_vars);
@@ -1540,9 +1467,9 @@ static void __devinet_sysctl_unregister(struct ipv4_devconf *cnf)
1540static void devinet_sysctl_register(struct in_device *idev) 1467static void devinet_sysctl_register(struct in_device *idev)
1541{ 1468{
1542 neigh_sysctl_register(idev->dev, idev->arp_parms, NET_IPV4, 1469 neigh_sysctl_register(idev->dev, idev->arp_parms, NET_IPV4,
1543 NET_IPV4_NEIGH, "ipv4", NULL, NULL); 1470 NET_IPV4_NEIGH, "ipv4", NULL);
1544 __devinet_sysctl_register(dev_net(idev->dev), idev->dev->name, 1471 __devinet_sysctl_register(dev_net(idev->dev), idev->dev->name,
1545 idev->dev->ifindex, &idev->cnf); 1472 &idev->cnf);
1546} 1473}
1547 1474
1548static void devinet_sysctl_unregister(struct in_device *idev) 1475static void devinet_sysctl_unregister(struct in_device *idev)
@@ -1553,14 +1480,12 @@ static void devinet_sysctl_unregister(struct in_device *idev)
1553 1480
1554static struct ctl_table ctl_forward_entry[] = { 1481static struct ctl_table ctl_forward_entry[] = {
1555 { 1482 {
1556 .ctl_name = NET_IPV4_FORWARD,
1557 .procname = "ip_forward", 1483 .procname = "ip_forward",
1558 .data = &ipv4_devconf.data[ 1484 .data = &ipv4_devconf.data[
1559 NET_IPV4_CONF_FORWARDING - 1], 1485 NET_IPV4_CONF_FORWARDING - 1],
1560 .maxlen = sizeof(int), 1486 .maxlen = sizeof(int),
1561 .mode = 0644, 1487 .mode = 0644,
1562 .proc_handler = devinet_sysctl_forward, 1488 .proc_handler = devinet_sysctl_forward,
1563 .strategy = devinet_conf_sysctl,
1564 .extra1 = &ipv4_devconf, 1489 .extra1 = &ipv4_devconf,
1565 .extra2 = &init_net, 1490 .extra2 = &init_net,
1566 }, 1491 },
@@ -1568,8 +1493,8 @@ static struct ctl_table ctl_forward_entry[] = {
1568}; 1493};
1569 1494
1570static __net_initdata struct ctl_path net_ipv4_path[] = { 1495static __net_initdata struct ctl_path net_ipv4_path[] = {
1571 { .procname = "net", .ctl_name = CTL_NET, }, 1496 { .procname = "net", },
1572 { .procname = "ipv4", .ctl_name = NET_IPV4, }, 1497 { .procname = "ipv4", },
1573 { }, 1498 { },
1574}; 1499};
1575#endif 1500#endif
@@ -1608,13 +1533,11 @@ static __net_init int devinet_init_net(struct net *net)
1608 } 1533 }
1609 1534
1610#ifdef CONFIG_SYSCTL 1535#ifdef CONFIG_SYSCTL
1611 err = __devinet_sysctl_register(net, "all", 1536 err = __devinet_sysctl_register(net, "all", all);
1612 NET_PROTO_CONF_ALL, all);
1613 if (err < 0) 1537 if (err < 0)
1614 goto err_reg_all; 1538 goto err_reg_all;
1615 1539
1616 err = __devinet_sysctl_register(net, "default", 1540 err = __devinet_sysctl_register(net, "default", dflt);
1617 NET_PROTO_CONF_DEFAULT, dflt);
1618 if (err < 0) 1541 if (err < 0)
1619 goto err_reg_dflt; 1542 goto err_reg_dflt;
1620 1543
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index d3fe10be7219..301a389fa7fa 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -603,7 +603,6 @@ static int zero;
603 603
604static struct ctl_table ip4_frags_ns_ctl_table[] = { 604static struct ctl_table ip4_frags_ns_ctl_table[] = {
605 { 605 {
606 .ctl_name = NET_IPV4_IPFRAG_HIGH_THRESH,
607 .procname = "ipfrag_high_thresh", 606 .procname = "ipfrag_high_thresh",
608 .data = &init_net.ipv4.frags.high_thresh, 607 .data = &init_net.ipv4.frags.high_thresh,
609 .maxlen = sizeof(int), 608 .maxlen = sizeof(int),
@@ -611,7 +610,6 @@ static struct ctl_table ip4_frags_ns_ctl_table[] = {
611 .proc_handler = proc_dointvec 610 .proc_handler = proc_dointvec
612 }, 611 },
613 { 612 {
614 .ctl_name = NET_IPV4_IPFRAG_LOW_THRESH,
615 .procname = "ipfrag_low_thresh", 613 .procname = "ipfrag_low_thresh",
616 .data = &init_net.ipv4.frags.low_thresh, 614 .data = &init_net.ipv4.frags.low_thresh,
617 .maxlen = sizeof(int), 615 .maxlen = sizeof(int),
@@ -619,26 +617,22 @@ static struct ctl_table ip4_frags_ns_ctl_table[] = {
619 .proc_handler = proc_dointvec 617 .proc_handler = proc_dointvec
620 }, 618 },
621 { 619 {
622 .ctl_name = NET_IPV4_IPFRAG_TIME,
623 .procname = "ipfrag_time", 620 .procname = "ipfrag_time",
624 .data = &init_net.ipv4.frags.timeout, 621 .data = &init_net.ipv4.frags.timeout,
625 .maxlen = sizeof(int), 622 .maxlen = sizeof(int),
626 .mode = 0644, 623 .mode = 0644,
627 .proc_handler = proc_dointvec_jiffies, 624 .proc_handler = proc_dointvec_jiffies,
628 .strategy = sysctl_jiffies
629 }, 625 },
630 { } 626 { }
631}; 627};
632 628
633static struct ctl_table ip4_frags_ctl_table[] = { 629static struct ctl_table ip4_frags_ctl_table[] = {
634 { 630 {
635 .ctl_name = NET_IPV4_IPFRAG_SECRET_INTERVAL,
636 .procname = "ipfrag_secret_interval", 631 .procname = "ipfrag_secret_interval",
637 .data = &ip4_frags.secret_interval, 632 .data = &ip4_frags.secret_interval,
638 .maxlen = sizeof(int), 633 .maxlen = sizeof(int),
639 .mode = 0644, 634 .mode = 0644,
640 .proc_handler = proc_dointvec_jiffies, 635 .proc_handler = proc_dointvec_jiffies,
641 .strategy = sysctl_jiffies
642 }, 636 },
643 { 637 {
644 .procname = "ipfrag_max_dist", 638 .procname = "ipfrag_max_dist",
diff --git a/net/ipv4/netfilter.c b/net/ipv4/netfilter.c
index 1725dc0ef688..db52c0cb0c11 100644
--- a/net/ipv4/netfilter.c
+++ b/net/ipv4/netfilter.c
@@ -248,9 +248,9 @@ module_exit(ipv4_netfilter_fini);
248 248
249#ifdef CONFIG_SYSCTL 249#ifdef CONFIG_SYSCTL
250struct ctl_path nf_net_ipv4_netfilter_sysctl_path[] = { 250struct ctl_path nf_net_ipv4_netfilter_sysctl_path[] = {
251 { .procname = "net", .ctl_name = CTL_NET, }, 251 { .procname = "net", },
252 { .procname = "ipv4", .ctl_name = NET_IPV4, }, 252 { .procname = "ipv4", },
253 { .procname = "netfilter", .ctl_name = NET_IPV4_NETFILTER, }, 253 { .procname = "netfilter", },
254 { } 254 { }
255}; 255};
256EXPORT_SYMBOL_GPL(nf_net_ipv4_netfilter_sysctl_path); 256EXPORT_SYMBOL_GPL(nf_net_ipv4_netfilter_sysctl_path);
diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c
index c156db215987..c9f90e8c5191 100644
--- a/net/ipv4/netfilter/ip_queue.c
+++ b/net/ipv4/netfilter/ip_queue.c
@@ -516,14 +516,13 @@ static struct ctl_table_header *ipq_sysctl_header;
516 516
517static ctl_table ipq_table[] = { 517static ctl_table ipq_table[] = {
518 { 518 {
519 .ctl_name = NET_IPQ_QMAX,
520 .procname = NET_IPQ_QMAX_NAME, 519 .procname = NET_IPQ_QMAX_NAME,
521 .data = &queue_maxlen, 520 .data = &queue_maxlen,
522 .maxlen = sizeof(queue_maxlen), 521 .maxlen = sizeof(queue_maxlen),
523 .mode = 0644, 522 .mode = 0644,
524 .proc_handler = proc_dointvec 523 .proc_handler = proc_dointvec
525 }, 524 },
526 { .ctl_name = 0 } 525 { }
527}; 526};
528#endif 527#endif
529 528
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
index aa95bb82ee6c..092d68f916e6 100644
--- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
+++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
@@ -195,7 +195,6 @@ static int log_invalid_proto_max = 255;
195 195
196static ctl_table ip_ct_sysctl_table[] = { 196static ctl_table ip_ct_sysctl_table[] = {
197 { 197 {
198 .ctl_name = NET_IPV4_NF_CONNTRACK_MAX,
199 .procname = "ip_conntrack_max", 198 .procname = "ip_conntrack_max",
200 .data = &nf_conntrack_max, 199 .data = &nf_conntrack_max,
201 .maxlen = sizeof(int), 200 .maxlen = sizeof(int),
@@ -203,7 +202,6 @@ static ctl_table ip_ct_sysctl_table[] = {
203 .proc_handler = proc_dointvec, 202 .proc_handler = proc_dointvec,
204 }, 203 },
205 { 204 {
206 .ctl_name = NET_IPV4_NF_CONNTRACK_COUNT,
207 .procname = "ip_conntrack_count", 205 .procname = "ip_conntrack_count",
208 .data = &init_net.ct.count, 206 .data = &init_net.ct.count,
209 .maxlen = sizeof(int), 207 .maxlen = sizeof(int),
@@ -211,7 +209,6 @@ static ctl_table ip_ct_sysctl_table[] = {
211 .proc_handler = proc_dointvec, 209 .proc_handler = proc_dointvec,
212 }, 210 },
213 { 211 {
214 .ctl_name = NET_IPV4_NF_CONNTRACK_BUCKETS,
215 .procname = "ip_conntrack_buckets", 212 .procname = "ip_conntrack_buckets",
216 .data = &nf_conntrack_htable_size, 213 .data = &nf_conntrack_htable_size,
217 .maxlen = sizeof(unsigned int), 214 .maxlen = sizeof(unsigned int),
@@ -219,7 +216,6 @@ static ctl_table ip_ct_sysctl_table[] = {
219 .proc_handler = proc_dointvec, 216 .proc_handler = proc_dointvec,
220 }, 217 },
221 { 218 {
222 .ctl_name = NET_IPV4_NF_CONNTRACK_CHECKSUM,
223 .procname = "ip_conntrack_checksum", 219 .procname = "ip_conntrack_checksum",
224 .data = &init_net.ct.sysctl_checksum, 220 .data = &init_net.ct.sysctl_checksum,
225 .maxlen = sizeof(int), 221 .maxlen = sizeof(int),
@@ -227,19 +223,15 @@ static ctl_table ip_ct_sysctl_table[] = {
227 .proc_handler = proc_dointvec, 223 .proc_handler = proc_dointvec,
228 }, 224 },
229 { 225 {
230 .ctl_name = NET_IPV4_NF_CONNTRACK_LOG_INVALID,
231 .procname = "ip_conntrack_log_invalid", 226 .procname = "ip_conntrack_log_invalid",
232 .data = &init_net.ct.sysctl_log_invalid, 227 .data = &init_net.ct.sysctl_log_invalid,
233 .maxlen = sizeof(unsigned int), 228 .maxlen = sizeof(unsigned int),
234 .mode = 0644, 229 .mode = 0644,
235 .proc_handler = proc_dointvec_minmax, 230 .proc_handler = proc_dointvec_minmax,
236 .strategy = sysctl_intvec,
237 .extra1 = &log_invalid_proto_min, 231 .extra1 = &log_invalid_proto_min,
238 .extra2 = &log_invalid_proto_max, 232 .extra2 = &log_invalid_proto_max,
239 }, 233 },
240 { 234 { }
241 .ctl_name = 0
242 }
243}; 235};
244#endif /* CONFIG_SYSCTL && CONFIG_NF_CONNTRACK_PROC_COMPAT */ 236#endif /* CONFIG_SYSCTL && CONFIG_NF_CONNTRACK_PROC_COMPAT */
245 237
diff --git a/net/ipv4/netfilter/nf_conntrack_proto_icmp.c b/net/ipv4/netfilter/nf_conntrack_proto_icmp.c
index d71ba7677344..9072058778b8 100644
--- a/net/ipv4/netfilter/nf_conntrack_proto_icmp.c
+++ b/net/ipv4/netfilter/nf_conntrack_proto_icmp.c
@@ -270,9 +270,7 @@ static struct ctl_table icmp_sysctl_table[] = {
270 .mode = 0644, 270 .mode = 0644,
271 .proc_handler = proc_dointvec_jiffies, 271 .proc_handler = proc_dointvec_jiffies,
272 }, 272 },
273 { 273 { }
274 .ctl_name = 0
275 }
276}; 274};
277#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT 275#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
278static struct ctl_table icmp_compat_sysctl_table[] = { 276static struct ctl_table icmp_compat_sysctl_table[] = {
@@ -283,9 +281,7 @@ static struct ctl_table icmp_compat_sysctl_table[] = {
283 .mode = 0644, 281 .mode = 0644,
284 .proc_handler = proc_dointvec_jiffies, 282 .proc_handler = proc_dointvec_jiffies,
285 }, 283 },
286 { 284 { }
287 .ctl_name = 0
288 }
289}; 285};
290#endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */ 286#endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */
291#endif /* CONFIG_SYSCTL */ 287#endif /* CONFIG_SYSCTL */
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 5b1050a5d874..0d9f584a3811 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -3056,23 +3056,6 @@ static int ipv4_sysctl_rtcache_flush(ctl_table *__ctl, int write,
3056 return -EINVAL; 3056 return -EINVAL;
3057} 3057}
3058 3058
3059static int ipv4_sysctl_rtcache_flush_strategy(ctl_table *table,
3060 void __user *oldval,
3061 size_t __user *oldlenp,
3062 void __user *newval,
3063 size_t newlen)
3064{
3065 int delay;
3066 struct net *net;
3067 if (newlen != sizeof(int))
3068 return -EINVAL;
3069 if (get_user(delay, (int __user *)newval))
3070 return -EFAULT;
3071 net = (struct net *)table->extra1;
3072 rt_cache_flush(net, delay);
3073 return 0;
3074}
3075
3076static void rt_secret_reschedule(int old) 3059static void rt_secret_reschedule(int old)
3077{ 3060{
3078 struct net *net; 3061 struct net *net;
@@ -3117,23 +3100,8 @@ static int ipv4_sysctl_rt_secret_interval(ctl_table *ctl, int write,
3117 return ret; 3100 return ret;
3118} 3101}
3119 3102
3120static int ipv4_sysctl_rt_secret_interval_strategy(ctl_table *table,
3121 void __user *oldval,
3122 size_t __user *oldlenp,
3123 void __user *newval,
3124 size_t newlen)
3125{
3126 int old = ip_rt_secret_interval;
3127 int ret = sysctl_jiffies(table, oldval, oldlenp, newval, newlen);
3128
3129 rt_secret_reschedule(old);
3130
3131 return ret;
3132}
3133
3134static ctl_table ipv4_route_table[] = { 3103static ctl_table ipv4_route_table[] = {
3135 { 3104 {
3136 .ctl_name = NET_IPV4_ROUTE_GC_THRESH,
3137 .procname = "gc_thresh", 3105 .procname = "gc_thresh",
3138 .data = &ipv4_dst_ops.gc_thresh, 3106 .data = &ipv4_dst_ops.gc_thresh,
3139 .maxlen = sizeof(int), 3107 .maxlen = sizeof(int),
@@ -3141,7 +3109,6 @@ static ctl_table ipv4_route_table[] = {
3141 .proc_handler = proc_dointvec, 3109 .proc_handler = proc_dointvec,
3142 }, 3110 },
3143 { 3111 {
3144 .ctl_name = NET_IPV4_ROUTE_MAX_SIZE,
3145 .procname = "max_size", 3112 .procname = "max_size",
3146 .data = &ip_rt_max_size, 3113 .data = &ip_rt_max_size,
3147 .maxlen = sizeof(int), 3114 .maxlen = sizeof(int),
@@ -3151,43 +3118,34 @@ static ctl_table ipv4_route_table[] = {
3151 { 3118 {
3152 /* Deprecated. Use gc_min_interval_ms */ 3119 /* Deprecated. Use gc_min_interval_ms */
3153 3120
3154 .ctl_name = NET_IPV4_ROUTE_GC_MIN_INTERVAL,
3155 .procname = "gc_min_interval", 3121 .procname = "gc_min_interval",
3156 .data = &ip_rt_gc_min_interval, 3122 .data = &ip_rt_gc_min_interval,
3157 .maxlen = sizeof(int), 3123 .maxlen = sizeof(int),
3158 .mode = 0644, 3124 .mode = 0644,
3159 .proc_handler = proc_dointvec_jiffies, 3125 .proc_handler = proc_dointvec_jiffies,
3160 .strategy = sysctl_jiffies,
3161 }, 3126 },
3162 { 3127 {
3163 .ctl_name = NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS,
3164 .procname = "gc_min_interval_ms", 3128 .procname = "gc_min_interval_ms",
3165 .data = &ip_rt_gc_min_interval, 3129 .data = &ip_rt_gc_min_interval,
3166 .maxlen = sizeof(int), 3130 .maxlen = sizeof(int),
3167 .mode = 0644, 3131 .mode = 0644,
3168 .proc_handler = proc_dointvec_ms_jiffies, 3132 .proc_handler = proc_dointvec_ms_jiffies,
3169 .strategy = sysctl_ms_jiffies,
3170 }, 3133 },
3171 { 3134 {
3172 .ctl_name = NET_IPV4_ROUTE_GC_TIMEOUT,
3173 .procname = "gc_timeout", 3135 .procname = "gc_timeout",
3174 .data = &ip_rt_gc_timeout, 3136 .data = &ip_rt_gc_timeout,
3175 .maxlen = sizeof(int), 3137 .maxlen = sizeof(int),
3176 .mode = 0644, 3138 .mode = 0644,
3177 .proc_handler = proc_dointvec_jiffies, 3139 .proc_handler = proc_dointvec_jiffies,
3178 .strategy = sysctl_jiffies,
3179 }, 3140 },
3180 { 3141 {
3181 .ctl_name = NET_IPV4_ROUTE_GC_INTERVAL,
3182 .procname = "gc_interval", 3142 .procname = "gc_interval",
3183 .data = &ip_rt_gc_interval, 3143 .data = &ip_rt_gc_interval,
3184 .maxlen = sizeof(int), 3144 .maxlen = sizeof(int),
3185 .mode = 0644, 3145 .mode = 0644,
3186 .proc_handler = proc_dointvec_jiffies, 3146 .proc_handler = proc_dointvec_jiffies,
3187 .strategy = sysctl_jiffies,
3188 }, 3147 },
3189 { 3148 {
3190 .ctl_name = NET_IPV4_ROUTE_REDIRECT_LOAD,
3191 .procname = "redirect_load", 3149 .procname = "redirect_load",
3192 .data = &ip_rt_redirect_load, 3150 .data = &ip_rt_redirect_load,
3193 .maxlen = sizeof(int), 3151 .maxlen = sizeof(int),
@@ -3195,7 +3153,6 @@ static ctl_table ipv4_route_table[] = {
3195 .proc_handler = proc_dointvec, 3153 .proc_handler = proc_dointvec,
3196 }, 3154 },
3197 { 3155 {
3198 .ctl_name = NET_IPV4_ROUTE_REDIRECT_NUMBER,
3199 .procname = "redirect_number", 3156 .procname = "redirect_number",
3200 .data = &ip_rt_redirect_number, 3157 .data = &ip_rt_redirect_number,
3201 .maxlen = sizeof(int), 3158 .maxlen = sizeof(int),
@@ -3203,7 +3160,6 @@ static ctl_table ipv4_route_table[] = {
3203 .proc_handler = proc_dointvec, 3160 .proc_handler = proc_dointvec,
3204 }, 3161 },
3205 { 3162 {
3206 .ctl_name = NET_IPV4_ROUTE_REDIRECT_SILENCE,
3207 .procname = "redirect_silence", 3163 .procname = "redirect_silence",
3208 .data = &ip_rt_redirect_silence, 3164 .data = &ip_rt_redirect_silence,
3209 .maxlen = sizeof(int), 3165 .maxlen = sizeof(int),
@@ -3211,7 +3167,6 @@ static ctl_table ipv4_route_table[] = {
3211 .proc_handler = proc_dointvec, 3167 .proc_handler = proc_dointvec,
3212 }, 3168 },
3213 { 3169 {
3214 .ctl_name = NET_IPV4_ROUTE_ERROR_COST,
3215 .procname = "error_cost", 3170 .procname = "error_cost",
3216 .data = &ip_rt_error_cost, 3171 .data = &ip_rt_error_cost,
3217 .maxlen = sizeof(int), 3172 .maxlen = sizeof(int),
@@ -3219,7 +3174,6 @@ static ctl_table ipv4_route_table[] = {
3219 .proc_handler = proc_dointvec, 3174 .proc_handler = proc_dointvec,
3220 }, 3175 },
3221 { 3176 {
3222 .ctl_name = NET_IPV4_ROUTE_ERROR_BURST,
3223 .procname = "error_burst", 3177 .procname = "error_burst",
3224 .data = &ip_rt_error_burst, 3178 .data = &ip_rt_error_burst,
3225 .maxlen = sizeof(int), 3179 .maxlen = sizeof(int),
@@ -3227,7 +3181,6 @@ static ctl_table ipv4_route_table[] = {
3227 .proc_handler = proc_dointvec, 3181 .proc_handler = proc_dointvec,
3228 }, 3182 },
3229 { 3183 {
3230 .ctl_name = NET_IPV4_ROUTE_GC_ELASTICITY,
3231 .procname = "gc_elasticity", 3184 .procname = "gc_elasticity",
3232 .data = &ip_rt_gc_elasticity, 3185 .data = &ip_rt_gc_elasticity,
3233 .maxlen = sizeof(int), 3186 .maxlen = sizeof(int),
@@ -3235,16 +3188,13 @@ static ctl_table ipv4_route_table[] = {
3235 .proc_handler = proc_dointvec, 3188 .proc_handler = proc_dointvec,
3236 }, 3189 },
3237 { 3190 {
3238 .ctl_name = NET_IPV4_ROUTE_MTU_EXPIRES,
3239 .procname = "mtu_expires", 3191 .procname = "mtu_expires",
3240 .data = &ip_rt_mtu_expires, 3192 .data = &ip_rt_mtu_expires,
3241 .maxlen = sizeof(int), 3193 .maxlen = sizeof(int),
3242 .mode = 0644, 3194 .mode = 0644,
3243 .proc_handler = proc_dointvec_jiffies, 3195 .proc_handler = proc_dointvec_jiffies,
3244 .strategy = sysctl_jiffies,
3245 }, 3196 },
3246 { 3197 {
3247 .ctl_name = NET_IPV4_ROUTE_MIN_PMTU,
3248 .procname = "min_pmtu", 3198 .procname = "min_pmtu",
3249 .data = &ip_rt_min_pmtu, 3199 .data = &ip_rt_min_pmtu,
3250 .maxlen = sizeof(int), 3200 .maxlen = sizeof(int),
@@ -3252,7 +3202,6 @@ static ctl_table ipv4_route_table[] = {
3252 .proc_handler = proc_dointvec, 3202 .proc_handler = proc_dointvec,
3253 }, 3203 },
3254 { 3204 {
3255 .ctl_name = NET_IPV4_ROUTE_MIN_ADVMSS,
3256 .procname = "min_adv_mss", 3205 .procname = "min_adv_mss",
3257 .data = &ip_rt_min_advmss, 3206 .data = &ip_rt_min_advmss,
3258 .maxlen = sizeof(int), 3207 .maxlen = sizeof(int),
@@ -3260,50 +3209,46 @@ static ctl_table ipv4_route_table[] = {
3260 .proc_handler = proc_dointvec, 3209 .proc_handler = proc_dointvec,
3261 }, 3210 },
3262 { 3211 {
3263 .ctl_name = NET_IPV4_ROUTE_SECRET_INTERVAL,
3264 .procname = "secret_interval", 3212 .procname = "secret_interval",
3265 .data = &ip_rt_secret_interval, 3213 .data = &ip_rt_secret_interval,
3266 .maxlen = sizeof(int), 3214 .maxlen = sizeof(int),
3267 .mode = 0644, 3215 .mode = 0644,
3268 .proc_handler = ipv4_sysctl_rt_secret_interval, 3216 .proc_handler = ipv4_sysctl_rt_secret_interval,
3269 .strategy = ipv4_sysctl_rt_secret_interval_strategy,
3270 }, 3217 },
3271 { .ctl_name = 0 } 3218 { }
3272}; 3219};
3273 3220
3274static struct ctl_table empty[1]; 3221static struct ctl_table empty[1];
3275 3222
3276static struct ctl_table ipv4_skeleton[] = 3223static struct ctl_table ipv4_skeleton[] =
3277{ 3224{
3278 { .procname = "route", .ctl_name = NET_IPV4_ROUTE, 3225 { .procname = "route",
3279 .mode = 0555, .child = ipv4_route_table}, 3226 .mode = 0555, .child = ipv4_route_table},
3280 { .procname = "neigh", .ctl_name = NET_IPV4_NEIGH, 3227 { .procname = "neigh",
3281 .mode = 0555, .child = empty}, 3228 .mode = 0555, .child = empty},
3282 { } 3229 { }
3283}; 3230};
3284 3231
3285static __net_initdata struct ctl_path ipv4_path[] = { 3232static __net_initdata struct ctl_path ipv4_path[] = {
3286 { .procname = "net", .ctl_name = CTL_NET, }, 3233 { .procname = "net", },
3287 { .procname = "ipv4", .ctl_name = NET_IPV4, }, 3234 { .procname = "ipv4", },
3288 { }, 3235 { },
3289}; 3236};
3290 3237
3291static struct ctl_table ipv4_route_flush_table[] = { 3238static struct ctl_table ipv4_route_flush_table[] = {
3292 { 3239 {
3293 .ctl_name = NET_IPV4_ROUTE_FLUSH,
3294 .procname = "flush", 3240 .procname = "flush",
3295 .maxlen = sizeof(int), 3241 .maxlen = sizeof(int),
3296 .mode = 0200, 3242 .mode = 0200,
3297 .proc_handler = ipv4_sysctl_rtcache_flush, 3243 .proc_handler = ipv4_sysctl_rtcache_flush,
3298 .strategy = ipv4_sysctl_rtcache_flush_strategy,
3299 }, 3244 },
3300 { .ctl_name = 0 }, 3245 { },
3301}; 3246};
3302 3247
3303static __net_initdata struct ctl_path ipv4_route_path[] = { 3248static __net_initdata struct ctl_path ipv4_route_path[] = {
3304 { .procname = "net", .ctl_name = CTL_NET, }, 3249 { .procname = "net", },
3305 { .procname = "ipv4", .ctl_name = NET_IPV4, }, 3250 { .procname = "ipv4", },
3306 { .procname = "route", .ctl_name = NET_IPV4_ROUTE, }, 3251 { .procname = "route", },
3307 { }, 3252 { },
3308}; 3253};
3309 3254
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 2dcf04d9b005..300056732953 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -63,34 +63,6 @@ static int ipv4_local_port_range(ctl_table *table, int write,
63 return ret; 63 return ret;
64} 64}
65 65
66/* Validate changes from sysctl interface. */
67static int ipv4_sysctl_local_port_range(ctl_table *table,
68 void __user *oldval,
69 size_t __user *oldlenp,
70 void __user *newval, size_t newlen)
71{
72 int ret;
73 int range[2];
74 ctl_table tmp = {
75 .data = &range,
76 .maxlen = sizeof(range),
77 .mode = table->mode,
78 .extra1 = &ip_local_port_range_min,
79 .extra2 = &ip_local_port_range_max,
80 };
81
82 inet_get_local_port_range(range, range + 1);
83 ret = sysctl_intvec(&tmp, oldval, oldlenp, newval, newlen);
84 if (ret == 0 && newval && newlen) {
85 if (range[1] < range[0])
86 ret = -EINVAL;
87 else
88 set_local_port_range(range);
89 }
90 return ret;
91}
92
93
94static int proc_tcp_congestion_control(ctl_table *ctl, int write, 66static int proc_tcp_congestion_control(ctl_table *ctl, int write,
95 void __user *buffer, size_t *lenp, loff_t *ppos) 67 void __user *buffer, size_t *lenp, loff_t *ppos)
96{ 68{
@@ -109,25 +81,6 @@ static int proc_tcp_congestion_control(ctl_table *ctl, int write,
109 return ret; 81 return ret;
110} 82}
111 83
112static int sysctl_tcp_congestion_control(ctl_table *table,
113 void __user *oldval,
114 size_t __user *oldlenp,
115 void __user *newval, size_t newlen)
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, oldval, oldlenp, newval, newlen);
126 if (ret == 1 && newval && newlen)
127 ret = tcp_set_default_congestion_control(val);
128 return ret;
129}
130
131static int proc_tcp_available_congestion_control(ctl_table *ctl, 84static int proc_tcp_available_congestion_control(ctl_table *ctl,
132 int write, 85 int write,
133 void __user *buffer, size_t *lenp, 86 void __user *buffer, size_t *lenp,
@@ -165,32 +118,8 @@ static int proc_allowed_congestion_control(ctl_table *ctl,
165 return ret; 118 return ret;
166} 119}
167 120
168static int strategy_allowed_congestion_control(ctl_table *table,
169 void __user *oldval,
170 size_t __user *oldlenp,
171 void __user *newval,
172 size_t newlen)
173{
174 ctl_table tbl = { .maxlen = TCP_CA_BUF_MAX };
175 int ret;
176
177 tbl.data = kmalloc(tbl.maxlen, GFP_USER);
178 if (!tbl.data)
179 return -ENOMEM;
180
181 tcp_get_available_congestion_control(tbl.data, tbl.maxlen);
182 ret = sysctl_string(&tbl, oldval, oldlenp, newval, newlen);
183 if (ret == 1 && newval && newlen)
184 ret = tcp_set_allowed_congestion_control(tbl.data);
185 kfree(tbl.data);
186
187 return ret;
188
189}
190
191static struct ctl_table ipv4_table[] = { 121static struct ctl_table ipv4_table[] = {
192 { 122 {
193 .ctl_name = NET_IPV4_TCP_TIMESTAMPS,
194 .procname = "tcp_timestamps", 123 .procname = "tcp_timestamps",
195 .data = &sysctl_tcp_timestamps, 124 .data = &sysctl_tcp_timestamps,
196 .maxlen = sizeof(int), 125 .maxlen = sizeof(int),
@@ -198,7 +127,6 @@ static struct ctl_table ipv4_table[] = {
198 .proc_handler = proc_dointvec 127 .proc_handler = proc_dointvec
199 }, 128 },
200 { 129 {
201 .ctl_name = NET_IPV4_TCP_WINDOW_SCALING,
202 .procname = "tcp_window_scaling", 130 .procname = "tcp_window_scaling",
203 .data = &sysctl_tcp_window_scaling, 131 .data = &sysctl_tcp_window_scaling,
204 .maxlen = sizeof(int), 132 .maxlen = sizeof(int),
@@ -206,7 +134,6 @@ static struct ctl_table ipv4_table[] = {
206 .proc_handler = proc_dointvec 134 .proc_handler = proc_dointvec
207 }, 135 },
208 { 136 {
209 .ctl_name = NET_IPV4_TCP_SACK,
210 .procname = "tcp_sack", 137 .procname = "tcp_sack",
211 .data = &sysctl_tcp_sack, 138 .data = &sysctl_tcp_sack,
212 .maxlen = sizeof(int), 139 .maxlen = sizeof(int),
@@ -214,7 +141,6 @@ static struct ctl_table ipv4_table[] = {
214 .proc_handler = proc_dointvec 141 .proc_handler = proc_dointvec
215 }, 142 },
216 { 143 {
217 .ctl_name = NET_IPV4_TCP_RETRANS_COLLAPSE,
218 .procname = "tcp_retrans_collapse", 144 .procname = "tcp_retrans_collapse",
219 .data = &sysctl_tcp_retrans_collapse, 145 .data = &sysctl_tcp_retrans_collapse,
220 .maxlen = sizeof(int), 146 .maxlen = sizeof(int),
@@ -222,17 +148,14 @@ static struct ctl_table ipv4_table[] = {
222 .proc_handler = proc_dointvec 148 .proc_handler = proc_dointvec
223 }, 149 },
224 { 150 {
225 .ctl_name = NET_IPV4_DEFAULT_TTL,
226 .procname = "ip_default_ttl", 151 .procname = "ip_default_ttl",
227 .data = &sysctl_ip_default_ttl, 152 .data = &sysctl_ip_default_ttl,
228 .maxlen = sizeof(int), 153 .maxlen = sizeof(int),
229 .mode = 0644, 154 .mode = 0644,
230 .proc_handler = ipv4_doint_and_flush, 155 .proc_handler = ipv4_doint_and_flush,
231 .strategy = ipv4_doint_and_flush_strategy,
232 .extra2 = &init_net, 156 .extra2 = &init_net,
233 }, 157 },
234 { 158 {
235 .ctl_name = NET_IPV4_NO_PMTU_DISC,
236 .procname = "ip_no_pmtu_disc", 159 .procname = "ip_no_pmtu_disc",
237 .data = &ipv4_config.no_pmtu_disc, 160 .data = &ipv4_config.no_pmtu_disc,
238 .maxlen = sizeof(int), 161 .maxlen = sizeof(int),
@@ -240,7 +163,6 @@ static struct ctl_table ipv4_table[] = {
240 .proc_handler = proc_dointvec 163 .proc_handler = proc_dointvec
241 }, 164 },
242 { 165 {
243 .ctl_name = NET_IPV4_NONLOCAL_BIND,
244 .procname = "ip_nonlocal_bind", 166 .procname = "ip_nonlocal_bind",
245 .data = &sysctl_ip_nonlocal_bind, 167 .data = &sysctl_ip_nonlocal_bind,
246 .maxlen = sizeof(int), 168 .maxlen = sizeof(int),
@@ -248,7 +170,6 @@ static struct ctl_table ipv4_table[] = {
248 .proc_handler = proc_dointvec 170 .proc_handler = proc_dointvec
249 }, 171 },
250 { 172 {
251 .ctl_name = NET_IPV4_TCP_SYN_RETRIES,
252 .procname = "tcp_syn_retries", 173 .procname = "tcp_syn_retries",
253 .data = &sysctl_tcp_syn_retries, 174 .data = &sysctl_tcp_syn_retries,
254 .maxlen = sizeof(int), 175 .maxlen = sizeof(int),
@@ -256,7 +177,6 @@ static struct ctl_table ipv4_table[] = {
256 .proc_handler = proc_dointvec 177 .proc_handler = proc_dointvec
257 }, 178 },
258 { 179 {
259 .ctl_name = NET_TCP_SYNACK_RETRIES,
260 .procname = "tcp_synack_retries", 180 .procname = "tcp_synack_retries",
261 .data = &sysctl_tcp_synack_retries, 181 .data = &sysctl_tcp_synack_retries,
262 .maxlen = sizeof(int), 182 .maxlen = sizeof(int),
@@ -264,7 +184,6 @@ static struct ctl_table ipv4_table[] = {
264 .proc_handler = proc_dointvec 184 .proc_handler = proc_dointvec
265 }, 185 },
266 { 186 {
267 .ctl_name = NET_TCP_MAX_ORPHANS,
268 .procname = "tcp_max_orphans", 187 .procname = "tcp_max_orphans",
269 .data = &sysctl_tcp_max_orphans, 188 .data = &sysctl_tcp_max_orphans,
270 .maxlen = sizeof(int), 189 .maxlen = sizeof(int),
@@ -272,7 +191,6 @@ static struct ctl_table ipv4_table[] = {
272 .proc_handler = proc_dointvec 191 .proc_handler = proc_dointvec
273 }, 192 },
274 { 193 {
275 .ctl_name = NET_TCP_MAX_TW_BUCKETS,
276 .procname = "tcp_max_tw_buckets", 194 .procname = "tcp_max_tw_buckets",
277 .data = &tcp_death_row.sysctl_max_tw_buckets, 195 .data = &tcp_death_row.sysctl_max_tw_buckets,
278 .maxlen = sizeof(int), 196 .maxlen = sizeof(int),
@@ -280,7 +198,6 @@ static struct ctl_table ipv4_table[] = {
280 .proc_handler = proc_dointvec 198 .proc_handler = proc_dointvec
281 }, 199 },
282 { 200 {
283 .ctl_name = NET_IPV4_DYNADDR,
284 .procname = "ip_dynaddr", 201 .procname = "ip_dynaddr",
285 .data = &sysctl_ip_dynaddr, 202 .data = &sysctl_ip_dynaddr,
286 .maxlen = sizeof(int), 203 .maxlen = sizeof(int),
@@ -288,16 +205,13 @@ static struct ctl_table ipv4_table[] = {
288 .proc_handler = proc_dointvec 205 .proc_handler = proc_dointvec
289 }, 206 },
290 { 207 {
291 .ctl_name = NET_IPV4_TCP_KEEPALIVE_TIME,
292 .procname = "tcp_keepalive_time", 208 .procname = "tcp_keepalive_time",
293 .data = &sysctl_tcp_keepalive_time, 209 .data = &sysctl_tcp_keepalive_time,
294 .maxlen = sizeof(int), 210 .maxlen = sizeof(int),
295 .mode = 0644, 211 .mode = 0644,
296 .proc_handler = proc_dointvec_jiffies, 212 .proc_handler = proc_dointvec_jiffies,
297 .strategy = sysctl_jiffies
298 }, 213 },
299 { 214 {
300 .ctl_name = NET_IPV4_TCP_KEEPALIVE_PROBES,
301 .procname = "tcp_keepalive_probes", 215 .procname = "tcp_keepalive_probes",
302 .data = &sysctl_tcp_keepalive_probes, 216 .data = &sysctl_tcp_keepalive_probes,
303 .maxlen = sizeof(int), 217 .maxlen = sizeof(int),
@@ -305,26 +219,21 @@ static struct ctl_table ipv4_table[] = {
305 .proc_handler = proc_dointvec 219 .proc_handler = proc_dointvec
306 }, 220 },
307 { 221 {
308 .ctl_name = NET_IPV4_TCP_KEEPALIVE_INTVL,
309 .procname = "tcp_keepalive_intvl", 222 .procname = "tcp_keepalive_intvl",
310 .data = &sysctl_tcp_keepalive_intvl, 223 .data = &sysctl_tcp_keepalive_intvl,
311 .maxlen = sizeof(int), 224 .maxlen = sizeof(int),
312 .mode = 0644, 225 .mode = 0644,
313 .proc_handler = proc_dointvec_jiffies, 226 .proc_handler = proc_dointvec_jiffies,
314 .strategy = sysctl_jiffies
315 }, 227 },
316 { 228 {
317 .ctl_name = NET_IPV4_TCP_RETRIES1,
318 .procname = "tcp_retries1", 229 .procname = "tcp_retries1",
319 .data = &sysctl_tcp_retries1, 230 .data = &sysctl_tcp_retries1,
320 .maxlen = sizeof(int), 231 .maxlen = sizeof(int),
321 .mode = 0644, 232 .mode = 0644,
322 .proc_handler = proc_dointvec_minmax, 233 .proc_handler = proc_dointvec_minmax,
323 .strategy = sysctl_intvec,
324 .extra2 = &tcp_retr1_max 234 .extra2 = &tcp_retr1_max
325 }, 235 },
326 { 236 {
327 .ctl_name = NET_IPV4_TCP_RETRIES2,
328 .procname = "tcp_retries2", 237 .procname = "tcp_retries2",
329 .data = &sysctl_tcp_retries2, 238 .data = &sysctl_tcp_retries2,
330 .maxlen = sizeof(int), 239 .maxlen = sizeof(int),
@@ -332,17 +241,14 @@ static struct ctl_table ipv4_table[] = {
332 .proc_handler = proc_dointvec 241 .proc_handler = proc_dointvec
333 }, 242 },
334 { 243 {
335 .ctl_name = NET_IPV4_TCP_FIN_TIMEOUT,
336 .procname = "tcp_fin_timeout", 244 .procname = "tcp_fin_timeout",
337 .data = &sysctl_tcp_fin_timeout, 245 .data = &sysctl_tcp_fin_timeout,
338 .maxlen = sizeof(int), 246 .maxlen = sizeof(int),
339 .mode = 0644, 247 .mode = 0644,
340 .proc_handler = proc_dointvec_jiffies, 248 .proc_handler = proc_dointvec_jiffies,
341 .strategy = sysctl_jiffies
342 }, 249 },
343#ifdef CONFIG_SYN_COOKIES 250#ifdef CONFIG_SYN_COOKIES
344 { 251 {
345 .ctl_name = NET_TCP_SYNCOOKIES,
346 .procname = "tcp_syncookies", 252 .procname = "tcp_syncookies",
347 .data = &sysctl_tcp_syncookies, 253 .data = &sysctl_tcp_syncookies,
348 .maxlen = sizeof(int), 254 .maxlen = sizeof(int),
@@ -351,7 +257,6 @@ static struct ctl_table ipv4_table[] = {
351 }, 257 },
352#endif 258#endif
353 { 259 {
354 .ctl_name = NET_TCP_TW_RECYCLE,
355 .procname = "tcp_tw_recycle", 260 .procname = "tcp_tw_recycle",
356 .data = &tcp_death_row.sysctl_tw_recycle, 261 .data = &tcp_death_row.sysctl_tw_recycle,
357 .maxlen = sizeof(int), 262 .maxlen = sizeof(int),
@@ -359,7 +264,6 @@ static struct ctl_table ipv4_table[] = {
359 .proc_handler = proc_dointvec 264 .proc_handler = proc_dointvec
360 }, 265 },
361 { 266 {
362 .ctl_name = NET_TCP_ABORT_ON_OVERFLOW,
363 .procname = "tcp_abort_on_overflow", 267 .procname = "tcp_abort_on_overflow",
364 .data = &sysctl_tcp_abort_on_overflow, 268 .data = &sysctl_tcp_abort_on_overflow,
365 .maxlen = sizeof(int), 269 .maxlen = sizeof(int),
@@ -367,7 +271,6 @@ static struct ctl_table ipv4_table[] = {
367 .proc_handler = proc_dointvec 271 .proc_handler = proc_dointvec
368 }, 272 },
369 { 273 {
370 .ctl_name = NET_TCP_STDURG,
371 .procname = "tcp_stdurg", 274 .procname = "tcp_stdurg",
372 .data = &sysctl_tcp_stdurg, 275 .data = &sysctl_tcp_stdurg,
373 .maxlen = sizeof(int), 276 .maxlen = sizeof(int),
@@ -375,7 +278,6 @@ static struct ctl_table ipv4_table[] = {
375 .proc_handler = proc_dointvec 278 .proc_handler = proc_dointvec
376 }, 279 },
377 { 280 {
378 .ctl_name = NET_TCP_RFC1337,
379 .procname = "tcp_rfc1337", 281 .procname = "tcp_rfc1337",
380 .data = &sysctl_tcp_rfc1337, 282 .data = &sysctl_tcp_rfc1337,
381 .maxlen = sizeof(int), 283 .maxlen = sizeof(int),
@@ -383,7 +285,6 @@ static struct ctl_table ipv4_table[] = {
383 .proc_handler = proc_dointvec 285 .proc_handler = proc_dointvec
384 }, 286 },
385 { 287 {
386 .ctl_name = NET_TCP_MAX_SYN_BACKLOG,
387 .procname = "tcp_max_syn_backlog", 288 .procname = "tcp_max_syn_backlog",
388 .data = &sysctl_max_syn_backlog, 289 .data = &sysctl_max_syn_backlog,
389 .maxlen = sizeof(int), 290 .maxlen = sizeof(int),
@@ -391,17 +292,14 @@ static struct ctl_table ipv4_table[] = {
391 .proc_handler = proc_dointvec 292 .proc_handler = proc_dointvec
392 }, 293 },
393 { 294 {
394 .ctl_name = NET_IPV4_LOCAL_PORT_RANGE,
395 .procname = "ip_local_port_range", 295 .procname = "ip_local_port_range",
396 .data = &sysctl_local_ports.range, 296 .data = &sysctl_local_ports.range,
397 .maxlen = sizeof(sysctl_local_ports.range), 297 .maxlen = sizeof(sysctl_local_ports.range),
398 .mode = 0644, 298 .mode = 0644,
399 .proc_handler = ipv4_local_port_range, 299 .proc_handler = ipv4_local_port_range,
400 .strategy = ipv4_sysctl_local_port_range,
401 }, 300 },
402#ifdef CONFIG_IP_MULTICAST 301#ifdef CONFIG_IP_MULTICAST
403 { 302 {
404 .ctl_name = NET_IPV4_IGMP_MAX_MEMBERSHIPS,
405 .procname = "igmp_max_memberships", 303 .procname = "igmp_max_memberships",
406 .data = &sysctl_igmp_max_memberships, 304 .data = &sysctl_igmp_max_memberships,
407 .maxlen = sizeof(int), 305 .maxlen = sizeof(int),
@@ -411,7 +309,6 @@ static struct ctl_table ipv4_table[] = {
411 309
412#endif 310#endif
413 { 311 {
414 .ctl_name = NET_IPV4_IGMP_MAX_MSF,
415 .procname = "igmp_max_msf", 312 .procname = "igmp_max_msf",
416 .data = &sysctl_igmp_max_msf, 313 .data = &sysctl_igmp_max_msf,
417 .maxlen = sizeof(int), 314 .maxlen = sizeof(int),
@@ -419,7 +316,6 @@ static struct ctl_table ipv4_table[] = {
419 .proc_handler = proc_dointvec 316 .proc_handler = proc_dointvec
420 }, 317 },
421 { 318 {
422 .ctl_name = NET_IPV4_INET_PEER_THRESHOLD,
423 .procname = "inet_peer_threshold", 319 .procname = "inet_peer_threshold",
424 .data = &inet_peer_threshold, 320 .data = &inet_peer_threshold,
425 .maxlen = sizeof(int), 321 .maxlen = sizeof(int),
@@ -427,43 +323,34 @@ static struct ctl_table ipv4_table[] = {
427 .proc_handler = proc_dointvec 323 .proc_handler = proc_dointvec
428 }, 324 },
429 { 325 {
430 .ctl_name = NET_IPV4_INET_PEER_MINTTL,
431 .procname = "inet_peer_minttl", 326 .procname = "inet_peer_minttl",
432 .data = &inet_peer_minttl, 327 .data = &inet_peer_minttl,
433 .maxlen = sizeof(int), 328 .maxlen = sizeof(int),
434 .mode = 0644, 329 .mode = 0644,
435 .proc_handler = proc_dointvec_jiffies, 330 .proc_handler = proc_dointvec_jiffies,
436 .strategy = sysctl_jiffies
437 }, 331 },
438 { 332 {
439 .ctl_name = NET_IPV4_INET_PEER_MAXTTL,
440 .procname = "inet_peer_maxttl", 333 .procname = "inet_peer_maxttl",
441 .data = &inet_peer_maxttl, 334 .data = &inet_peer_maxttl,
442 .maxlen = sizeof(int), 335 .maxlen = sizeof(int),
443 .mode = 0644, 336 .mode = 0644,
444 .proc_handler = proc_dointvec_jiffies, 337 .proc_handler = proc_dointvec_jiffies,
445 .strategy = sysctl_jiffies
446 }, 338 },
447 { 339 {
448 .ctl_name = NET_IPV4_INET_PEER_GC_MINTIME,
449 .procname = "inet_peer_gc_mintime", 340 .procname = "inet_peer_gc_mintime",
450 .data = &inet_peer_gc_mintime, 341 .data = &inet_peer_gc_mintime,
451 .maxlen = sizeof(int), 342 .maxlen = sizeof(int),
452 .mode = 0644, 343 .mode = 0644,
453 .proc_handler = proc_dointvec_jiffies, 344 .proc_handler = proc_dointvec_jiffies,
454 .strategy = sysctl_jiffies
455 }, 345 },
456 { 346 {
457 .ctl_name = NET_IPV4_INET_PEER_GC_MAXTIME,
458 .procname = "inet_peer_gc_maxtime", 347 .procname = "inet_peer_gc_maxtime",
459 .data = &inet_peer_gc_maxtime, 348 .data = &inet_peer_gc_maxtime,
460 .maxlen = sizeof(int), 349 .maxlen = sizeof(int),
461 .mode = 0644, 350 .mode = 0644,
462 .proc_handler = proc_dointvec_jiffies, 351 .proc_handler = proc_dointvec_jiffies,
463 .strategy = sysctl_jiffies
464 }, 352 },
465 { 353 {
466 .ctl_name = NET_TCP_ORPHAN_RETRIES,
467 .procname = "tcp_orphan_retries", 354 .procname = "tcp_orphan_retries",
468 .data = &sysctl_tcp_orphan_retries, 355 .data = &sysctl_tcp_orphan_retries,
469 .maxlen = sizeof(int), 356 .maxlen = sizeof(int),
@@ -471,7 +358,6 @@ static struct ctl_table ipv4_table[] = {
471 .proc_handler = proc_dointvec 358 .proc_handler = proc_dointvec
472 }, 359 },
473 { 360 {
474 .ctl_name = NET_TCP_FACK,
475 .procname = "tcp_fack", 361 .procname = "tcp_fack",
476 .data = &sysctl_tcp_fack, 362 .data = &sysctl_tcp_fack,
477 .maxlen = sizeof(int), 363 .maxlen = sizeof(int),
@@ -479,7 +365,6 @@ static struct ctl_table ipv4_table[] = {
479 .proc_handler = proc_dointvec 365 .proc_handler = proc_dointvec
480 }, 366 },
481 { 367 {
482 .ctl_name = NET_TCP_REORDERING,
483 .procname = "tcp_reordering", 368 .procname = "tcp_reordering",
484 .data = &sysctl_tcp_reordering, 369 .data = &sysctl_tcp_reordering,
485 .maxlen = sizeof(int), 370 .maxlen = sizeof(int),
@@ -487,7 +372,6 @@ static struct ctl_table ipv4_table[] = {
487 .proc_handler = proc_dointvec 372 .proc_handler = proc_dointvec
488 }, 373 },
489 { 374 {
490 .ctl_name = NET_TCP_ECN,
491 .procname = "tcp_ecn", 375 .procname = "tcp_ecn",
492 .data = &sysctl_tcp_ecn, 376 .data = &sysctl_tcp_ecn,
493 .maxlen = sizeof(int), 377 .maxlen = sizeof(int),
@@ -495,7 +379,6 @@ static struct ctl_table ipv4_table[] = {
495 .proc_handler = proc_dointvec 379 .proc_handler = proc_dointvec
496 }, 380 },
497 { 381 {
498 .ctl_name = NET_TCP_DSACK,
499 .procname = "tcp_dsack", 382 .procname = "tcp_dsack",
500 .data = &sysctl_tcp_dsack, 383 .data = &sysctl_tcp_dsack,
501 .maxlen = sizeof(int), 384 .maxlen = sizeof(int),
@@ -503,7 +386,6 @@ static struct ctl_table ipv4_table[] = {
503 .proc_handler = proc_dointvec 386 .proc_handler = proc_dointvec
504 }, 387 },
505 { 388 {
506 .ctl_name = NET_TCP_MEM,
507 .procname = "tcp_mem", 389 .procname = "tcp_mem",
508 .data = &sysctl_tcp_mem, 390 .data = &sysctl_tcp_mem,
509 .maxlen = sizeof(sysctl_tcp_mem), 391 .maxlen = sizeof(sysctl_tcp_mem),
@@ -511,7 +393,6 @@ static struct ctl_table ipv4_table[] = {
511 .proc_handler = proc_dointvec 393 .proc_handler = proc_dointvec
512 }, 394 },
513 { 395 {
514 .ctl_name = NET_TCP_WMEM,
515 .procname = "tcp_wmem", 396 .procname = "tcp_wmem",
516 .data = &sysctl_tcp_wmem, 397 .data = &sysctl_tcp_wmem,
517 .maxlen = sizeof(sysctl_tcp_wmem), 398 .maxlen = sizeof(sysctl_tcp_wmem),
@@ -519,7 +400,6 @@ static struct ctl_table ipv4_table[] = {
519 .proc_handler = proc_dointvec 400 .proc_handler = proc_dointvec
520 }, 401 },
521 { 402 {
522 .ctl_name = NET_TCP_RMEM,
523 .procname = "tcp_rmem", 403 .procname = "tcp_rmem",
524 .data = &sysctl_tcp_rmem, 404 .data = &sysctl_tcp_rmem,
525 .maxlen = sizeof(sysctl_tcp_rmem), 405 .maxlen = sizeof(sysctl_tcp_rmem),
@@ -527,7 +407,6 @@ static struct ctl_table ipv4_table[] = {
527 .proc_handler = proc_dointvec 407 .proc_handler = proc_dointvec
528 }, 408 },
529 { 409 {
530 .ctl_name = NET_TCP_APP_WIN,
531 .procname = "tcp_app_win", 410 .procname = "tcp_app_win",
532 .data = &sysctl_tcp_app_win, 411 .data = &sysctl_tcp_app_win,
533 .maxlen = sizeof(int), 412 .maxlen = sizeof(int),
@@ -535,7 +414,6 @@ static struct ctl_table ipv4_table[] = {
535 .proc_handler = proc_dointvec 414 .proc_handler = proc_dointvec
536 }, 415 },
537 { 416 {
538 .ctl_name = NET_TCP_ADV_WIN_SCALE,
539 .procname = "tcp_adv_win_scale", 417 .procname = "tcp_adv_win_scale",
540 .data = &sysctl_tcp_adv_win_scale, 418 .data = &sysctl_tcp_adv_win_scale,
541 .maxlen = sizeof(int), 419 .maxlen = sizeof(int),
@@ -543,7 +421,6 @@ static struct ctl_table ipv4_table[] = {
543 .proc_handler = proc_dointvec 421 .proc_handler = proc_dointvec
544 }, 422 },
545 { 423 {
546 .ctl_name = NET_TCP_TW_REUSE,
547 .procname = "tcp_tw_reuse", 424 .procname = "tcp_tw_reuse",
548 .data = &sysctl_tcp_tw_reuse, 425 .data = &sysctl_tcp_tw_reuse,
549 .maxlen = sizeof(int), 426 .maxlen = sizeof(int),
@@ -551,7 +428,6 @@ static struct ctl_table ipv4_table[] = {
551 .proc_handler = proc_dointvec 428 .proc_handler = proc_dointvec
552 }, 429 },
553 { 430 {
554 .ctl_name = NET_TCP_FRTO,
555 .procname = "tcp_frto", 431 .procname = "tcp_frto",
556 .data = &sysctl_tcp_frto, 432 .data = &sysctl_tcp_frto,
557 .maxlen = sizeof(int), 433 .maxlen = sizeof(int),
@@ -559,7 +435,6 @@ static struct ctl_table ipv4_table[] = {
559 .proc_handler = proc_dointvec 435 .proc_handler = proc_dointvec
560 }, 436 },
561 { 437 {
562 .ctl_name = NET_TCP_FRTO_RESPONSE,
563 .procname = "tcp_frto_response", 438 .procname = "tcp_frto_response",
564 .data = &sysctl_tcp_frto_response, 439 .data = &sysctl_tcp_frto_response,
565 .maxlen = sizeof(int), 440 .maxlen = sizeof(int),
@@ -567,7 +442,6 @@ static struct ctl_table ipv4_table[] = {
567 .proc_handler = proc_dointvec 442 .proc_handler = proc_dointvec
568 }, 443 },
569 { 444 {
570 .ctl_name = NET_TCP_LOW_LATENCY,
571 .procname = "tcp_low_latency", 445 .procname = "tcp_low_latency",
572 .data = &sysctl_tcp_low_latency, 446 .data = &sysctl_tcp_low_latency,
573 .maxlen = sizeof(int), 447 .maxlen = sizeof(int),
@@ -575,7 +449,6 @@ static struct ctl_table ipv4_table[] = {
575 .proc_handler = proc_dointvec 449 .proc_handler = proc_dointvec
576 }, 450 },
577 { 451 {
578 .ctl_name = NET_TCP_NO_METRICS_SAVE,
579 .procname = "tcp_no_metrics_save", 452 .procname = "tcp_no_metrics_save",
580 .data = &sysctl_tcp_nometrics_save, 453 .data = &sysctl_tcp_nometrics_save,
581 .maxlen = sizeof(int), 454 .maxlen = sizeof(int),
@@ -583,7 +456,6 @@ static struct ctl_table ipv4_table[] = {
583 .proc_handler = proc_dointvec, 456 .proc_handler = proc_dointvec,
584 }, 457 },
585 { 458 {
586 .ctl_name = NET_TCP_MODERATE_RCVBUF,
587 .procname = "tcp_moderate_rcvbuf", 459 .procname = "tcp_moderate_rcvbuf",
588 .data = &sysctl_tcp_moderate_rcvbuf, 460 .data = &sysctl_tcp_moderate_rcvbuf,
589 .maxlen = sizeof(int), 461 .maxlen = sizeof(int),
@@ -591,7 +463,6 @@ static struct ctl_table ipv4_table[] = {
591 .proc_handler = proc_dointvec, 463 .proc_handler = proc_dointvec,
592 }, 464 },
593 { 465 {
594 .ctl_name = NET_TCP_TSO_WIN_DIVISOR,
595 .procname = "tcp_tso_win_divisor", 466 .procname = "tcp_tso_win_divisor",
596 .data = &sysctl_tcp_tso_win_divisor, 467 .data = &sysctl_tcp_tso_win_divisor,
597 .maxlen = sizeof(int), 468 .maxlen = sizeof(int),
@@ -599,15 +470,12 @@ static struct ctl_table ipv4_table[] = {
599 .proc_handler = proc_dointvec, 470 .proc_handler = proc_dointvec,
600 }, 471 },
601 { 472 {
602 .ctl_name = NET_TCP_CONG_CONTROL,
603 .procname = "tcp_congestion_control", 473 .procname = "tcp_congestion_control",
604 .mode = 0644, 474 .mode = 0644,
605 .maxlen = TCP_CA_NAME_MAX, 475 .maxlen = TCP_CA_NAME_MAX,
606 .proc_handler = proc_tcp_congestion_control, 476 .proc_handler = proc_tcp_congestion_control,
607 .strategy = sysctl_tcp_congestion_control,
608 }, 477 },
609 { 478 {
610 .ctl_name = NET_TCP_ABC,
611 .procname = "tcp_abc", 479 .procname = "tcp_abc",
612 .data = &sysctl_tcp_abc, 480 .data = &sysctl_tcp_abc,
613 .maxlen = sizeof(int), 481 .maxlen = sizeof(int),
@@ -615,7 +483,6 @@ static struct ctl_table ipv4_table[] = {
615 .proc_handler = proc_dointvec, 483 .proc_handler = proc_dointvec,
616 }, 484 },
617 { 485 {
618 .ctl_name = NET_TCP_MTU_PROBING,
619 .procname = "tcp_mtu_probing", 486 .procname = "tcp_mtu_probing",
620 .data = &sysctl_tcp_mtu_probing, 487 .data = &sysctl_tcp_mtu_probing,
621 .maxlen = sizeof(int), 488 .maxlen = sizeof(int),
@@ -623,7 +490,6 @@ static struct ctl_table ipv4_table[] = {
623 .proc_handler = proc_dointvec, 490 .proc_handler = proc_dointvec,
624 }, 491 },
625 { 492 {
626 .ctl_name = NET_TCP_BASE_MSS,
627 .procname = "tcp_base_mss", 493 .procname = "tcp_base_mss",
628 .data = &sysctl_tcp_base_mss, 494 .data = &sysctl_tcp_base_mss,
629 .maxlen = sizeof(int), 495 .maxlen = sizeof(int),
@@ -631,7 +497,6 @@ static struct ctl_table ipv4_table[] = {
631 .proc_handler = proc_dointvec, 497 .proc_handler = proc_dointvec,
632 }, 498 },
633 { 499 {
634 .ctl_name = NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS,
635 .procname = "tcp_workaround_signed_windows", 500 .procname = "tcp_workaround_signed_windows",
636 .data = &sysctl_tcp_workaround_signed_windows, 501 .data = &sysctl_tcp_workaround_signed_windows,
637 .maxlen = sizeof(int), 502 .maxlen = sizeof(int),
@@ -640,7 +505,6 @@ static struct ctl_table ipv4_table[] = {
640 }, 505 },
641#ifdef CONFIG_NET_DMA 506#ifdef CONFIG_NET_DMA
642 { 507 {
643 .ctl_name = NET_TCP_DMA_COPYBREAK,
644 .procname = "tcp_dma_copybreak", 508 .procname = "tcp_dma_copybreak",
645 .data = &sysctl_tcp_dma_copybreak, 509 .data = &sysctl_tcp_dma_copybreak,
646 .maxlen = sizeof(int), 510 .maxlen = sizeof(int),
@@ -649,7 +513,6 @@ static struct ctl_table ipv4_table[] = {
649 }, 513 },
650#endif 514#endif
651 { 515 {
652 .ctl_name = NET_TCP_SLOW_START_AFTER_IDLE,
653 .procname = "tcp_slow_start_after_idle", 516 .procname = "tcp_slow_start_after_idle",
654 .data = &sysctl_tcp_slow_start_after_idle, 517 .data = &sysctl_tcp_slow_start_after_idle,
655 .maxlen = sizeof(int), 518 .maxlen = sizeof(int),
@@ -658,7 +521,6 @@ static struct ctl_table ipv4_table[] = {
658 }, 521 },
659#ifdef CONFIG_NETLABEL 522#ifdef CONFIG_NETLABEL
660 { 523 {
661 .ctl_name = NET_CIPSOV4_CACHE_ENABLE,
662 .procname = "cipso_cache_enable", 524 .procname = "cipso_cache_enable",
663 .data = &cipso_v4_cache_enabled, 525 .data = &cipso_v4_cache_enabled,
664 .maxlen = sizeof(int), 526 .maxlen = sizeof(int),
@@ -666,7 +528,6 @@ static struct ctl_table ipv4_table[] = {
666 .proc_handler = proc_dointvec, 528 .proc_handler = proc_dointvec,
667 }, 529 },
668 { 530 {
669 .ctl_name = NET_CIPSOV4_CACHE_BUCKET_SIZE,
670 .procname = "cipso_cache_bucket_size", 531 .procname = "cipso_cache_bucket_size",
671 .data = &cipso_v4_cache_bucketsize, 532 .data = &cipso_v4_cache_bucketsize,
672 .maxlen = sizeof(int), 533 .maxlen = sizeof(int),
@@ -674,7 +535,6 @@ static struct ctl_table ipv4_table[] = {
674 .proc_handler = proc_dointvec, 535 .proc_handler = proc_dointvec,
675 }, 536 },
676 { 537 {
677 .ctl_name = NET_CIPSOV4_RBM_OPTFMT,
678 .procname = "cipso_rbm_optfmt", 538 .procname = "cipso_rbm_optfmt",
679 .data = &cipso_v4_rbm_optfmt, 539 .data = &cipso_v4_rbm_optfmt,
680 .maxlen = sizeof(int), 540 .maxlen = sizeof(int),
@@ -682,7 +542,6 @@ static struct ctl_table ipv4_table[] = {
682 .proc_handler = proc_dointvec, 542 .proc_handler = proc_dointvec,
683 }, 543 },
684 { 544 {
685 .ctl_name = NET_CIPSOV4_RBM_STRICTVALID,
686 .procname = "cipso_rbm_strictvalid", 545 .procname = "cipso_rbm_strictvalid",
687 .data = &cipso_v4_rbm_strictvalid, 546 .data = &cipso_v4_rbm_strictvalid,
688 .maxlen = sizeof(int), 547 .maxlen = sizeof(int),
@@ -697,15 +556,12 @@ static struct ctl_table ipv4_table[] = {
697 .proc_handler = proc_tcp_available_congestion_control, 556 .proc_handler = proc_tcp_available_congestion_control,
698 }, 557 },
699 { 558 {
700 .ctl_name = NET_TCP_ALLOWED_CONG_CONTROL,
701 .procname = "tcp_allowed_congestion_control", 559 .procname = "tcp_allowed_congestion_control",
702 .maxlen = TCP_CA_BUF_MAX, 560 .maxlen = TCP_CA_BUF_MAX,
703 .mode = 0644, 561 .mode = 0644,
704 .proc_handler = proc_allowed_congestion_control, 562 .proc_handler = proc_allowed_congestion_control,
705 .strategy = strategy_allowed_congestion_control,
706 }, 563 },
707 { 564 {
708 .ctl_name = NET_TCP_MAX_SSTHRESH,
709 .procname = "tcp_max_ssthresh", 565 .procname = "tcp_max_ssthresh",
710 .data = &sysctl_tcp_max_ssthresh, 566 .data = &sysctl_tcp_max_ssthresh,
711 .maxlen = sizeof(int), 567 .maxlen = sizeof(int),
@@ -713,41 +569,34 @@ static struct ctl_table ipv4_table[] = {
713 .proc_handler = proc_dointvec, 569 .proc_handler = proc_dointvec,
714 }, 570 },
715 { 571 {
716 .ctl_name = CTL_UNNUMBERED,
717 .procname = "udp_mem", 572 .procname = "udp_mem",
718 .data = &sysctl_udp_mem, 573 .data = &sysctl_udp_mem,
719 .maxlen = sizeof(sysctl_udp_mem), 574 .maxlen = sizeof(sysctl_udp_mem),
720 .mode = 0644, 575 .mode = 0644,
721 .proc_handler = proc_dointvec_minmax, 576 .proc_handler = proc_dointvec_minmax,
722 .strategy = sysctl_intvec,
723 .extra1 = &zero 577 .extra1 = &zero
724 }, 578 },
725 { 579 {
726 .ctl_name = CTL_UNNUMBERED,
727 .procname = "udp_rmem_min", 580 .procname = "udp_rmem_min",
728 .data = &sysctl_udp_rmem_min, 581 .data = &sysctl_udp_rmem_min,
729 .maxlen = sizeof(sysctl_udp_rmem_min), 582 .maxlen = sizeof(sysctl_udp_rmem_min),
730 .mode = 0644, 583 .mode = 0644,
731 .proc_handler = proc_dointvec_minmax, 584 .proc_handler = proc_dointvec_minmax,
732 .strategy = sysctl_intvec,
733 .extra1 = &zero 585 .extra1 = &zero
734 }, 586 },
735 { 587 {
736 .ctl_name = CTL_UNNUMBERED,
737 .procname = "udp_wmem_min", 588 .procname = "udp_wmem_min",
738 .data = &sysctl_udp_wmem_min, 589 .data = &sysctl_udp_wmem_min,
739 .maxlen = sizeof(sysctl_udp_wmem_min), 590 .maxlen = sizeof(sysctl_udp_wmem_min),
740 .mode = 0644, 591 .mode = 0644,
741 .proc_handler = proc_dointvec_minmax, 592 .proc_handler = proc_dointvec_minmax,
742 .strategy = sysctl_intvec,
743 .extra1 = &zero 593 .extra1 = &zero
744 }, 594 },
745 { .ctl_name = 0 } 595 { }
746}; 596};
747 597
748static struct ctl_table ipv4_net_table[] = { 598static struct ctl_table ipv4_net_table[] = {
749 { 599 {
750 .ctl_name = NET_IPV4_ICMP_ECHO_IGNORE_ALL,
751 .procname = "icmp_echo_ignore_all", 600 .procname = "icmp_echo_ignore_all",
752 .data = &init_net.ipv4.sysctl_icmp_echo_ignore_all, 601 .data = &init_net.ipv4.sysctl_icmp_echo_ignore_all,
753 .maxlen = sizeof(int), 602 .maxlen = sizeof(int),
@@ -755,7 +604,6 @@ static struct ctl_table ipv4_net_table[] = {
755 .proc_handler = proc_dointvec 604 .proc_handler = proc_dointvec
756 }, 605 },
757 { 606 {
758 .ctl_name = NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS,
759 .procname = "icmp_echo_ignore_broadcasts", 607 .procname = "icmp_echo_ignore_broadcasts",
760 .data = &init_net.ipv4.sysctl_icmp_echo_ignore_broadcasts, 608 .data = &init_net.ipv4.sysctl_icmp_echo_ignore_broadcasts,
761 .maxlen = sizeof(int), 609 .maxlen = sizeof(int),
@@ -763,7 +611,6 @@ static struct ctl_table ipv4_net_table[] = {
763 .proc_handler = proc_dointvec 611 .proc_handler = proc_dointvec
764 }, 612 },
765 { 613 {
766 .ctl_name = NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES,
767 .procname = "icmp_ignore_bogus_error_responses", 614 .procname = "icmp_ignore_bogus_error_responses",
768 .data = &init_net.ipv4.sysctl_icmp_ignore_bogus_error_responses, 615 .data = &init_net.ipv4.sysctl_icmp_ignore_bogus_error_responses,
769 .maxlen = sizeof(int), 616 .maxlen = sizeof(int),
@@ -771,7 +618,6 @@ static struct ctl_table ipv4_net_table[] = {
771 .proc_handler = proc_dointvec 618 .proc_handler = proc_dointvec
772 }, 619 },
773 { 620 {
774 .ctl_name = NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR,
775 .procname = "icmp_errors_use_inbound_ifaddr", 621 .procname = "icmp_errors_use_inbound_ifaddr",
776 .data = &init_net.ipv4.sysctl_icmp_errors_use_inbound_ifaddr, 622 .data = &init_net.ipv4.sysctl_icmp_errors_use_inbound_ifaddr,
777 .maxlen = sizeof(int), 623 .maxlen = sizeof(int),
@@ -779,16 +625,13 @@ static struct ctl_table ipv4_net_table[] = {
779 .proc_handler = proc_dointvec 625 .proc_handler = proc_dointvec
780 }, 626 },
781 { 627 {
782 .ctl_name = NET_IPV4_ICMP_RATELIMIT,
783 .procname = "icmp_ratelimit", 628 .procname = "icmp_ratelimit",
784 .data = &init_net.ipv4.sysctl_icmp_ratelimit, 629 .data = &init_net.ipv4.sysctl_icmp_ratelimit,
785 .maxlen = sizeof(int), 630 .maxlen = sizeof(int),
786 .mode = 0644, 631 .mode = 0644,
787 .proc_handler = proc_dointvec_ms_jiffies, 632 .proc_handler = proc_dointvec_ms_jiffies,
788 .strategy = sysctl_ms_jiffies
789 }, 633 },
790 { 634 {
791 .ctl_name = NET_IPV4_ICMP_RATEMASK,
792 .procname = "icmp_ratemask", 635 .procname = "icmp_ratemask",
793 .data = &init_net.ipv4.sysctl_icmp_ratemask, 636 .data = &init_net.ipv4.sysctl_icmp_ratemask,
794 .maxlen = sizeof(int), 637 .maxlen = sizeof(int),
@@ -796,7 +639,6 @@ static struct ctl_table ipv4_net_table[] = {
796 .proc_handler = proc_dointvec 639 .proc_handler = proc_dointvec
797 }, 640 },
798 { 641 {
799 .ctl_name = CTL_UNNUMBERED,
800 .procname = "rt_cache_rebuild_count", 642 .procname = "rt_cache_rebuild_count",
801 .data = &init_net.ipv4.sysctl_rt_cache_rebuild_count, 643 .data = &init_net.ipv4.sysctl_rt_cache_rebuild_count,
802 .maxlen = sizeof(int), 644 .maxlen = sizeof(int),
@@ -807,8 +649,8 @@ static struct ctl_table ipv4_net_table[] = {
807}; 649};
808 650
809struct ctl_path net_ipv4_ctl_path[] = { 651struct ctl_path net_ipv4_ctl_path[] = {
810 { .procname = "net", .ctl_name = CTL_NET, }, 652 { .procname = "net", },
811 { .procname = "ipv4", .ctl_name = NET_IPV4, }, 653 { .procname = "ipv4", },
812 { }, 654 { },
813}; 655};
814EXPORT_SYMBOL_GPL(net_ipv4_ctl_path); 656EXPORT_SYMBOL_GPL(net_ipv4_ctl_path);
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
index 74fb2eb833ec..8c08a28d8f83 100644
--- a/net/ipv4/xfrm4_policy.c
+++ b/net/ipv4/xfrm4_policy.c
@@ -267,7 +267,6 @@ static struct xfrm_policy_afinfo xfrm4_policy_afinfo = {
267#ifdef CONFIG_SYSCTL 267#ifdef CONFIG_SYSCTL
268static struct ctl_table xfrm4_policy_table[] = { 268static struct ctl_table xfrm4_policy_table[] = {
269 { 269 {
270 .ctl_name = CTL_UNNUMBERED,
271 .procname = "xfrm4_gc_thresh", 270 .procname = "xfrm4_gc_thresh",
272 .data = &xfrm4_dst_ops.gc_thresh, 271 .data = &xfrm4_dst_ops.gc_thresh,
273 .maxlen = sizeof(int), 272 .maxlen = sizeof(int),