diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2010-02-13 22:27:03 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-16 18:55:18 -0500 |
commit | 54716e3beb0ab20c49471348dfe399a71bfc8fd3 (patch) | |
tree | 216e2b70e58032217082da224c397db46c13429c /net | |
parent | 02291680ffba92e5b5865bc0c5e7d1f3056b80ec (diff) |
net neigh: Decouple per interface neighbour table controls from binary sysctls
Stop computing the number of neighbour table settings we have by
counting the number of binary sysctls. This behaviour was silly
and meant that we could not add another neighbour table setting
without also adding another binary sysctl.
Don't pass the binary sysctl path for neighour table entries
into neigh_sysctl_register. These parameters are no longer
used and so are just dead code.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/neighbour.c | 7 | ||||
-rw-r--r-- | net/ipv4/arp.c | 3 | ||||
-rw-r--r-- | net/ipv4/devinet.c | 3 | ||||
-rw-r--r-- | net/ipv6/addrconf.c | 3 | ||||
-rw-r--r-- | net/ipv6/ndisc.c | 3 |
5 files changed, 8 insertions, 11 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index f2efd72da799..d102f6d9abdc 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -2556,9 +2556,11 @@ EXPORT_SYMBOL(neigh_app_ns); | |||
2556 | 2556 | ||
2557 | #ifdef CONFIG_SYSCTL | 2557 | #ifdef CONFIG_SYSCTL |
2558 | 2558 | ||
2559 | #define NEIGH_VARS_MAX 19 | ||
2560 | |||
2559 | static struct neigh_sysctl_table { | 2561 | static struct neigh_sysctl_table { |
2560 | struct ctl_table_header *sysctl_header; | 2562 | struct ctl_table_header *sysctl_header; |
2561 | struct ctl_table neigh_vars[__NET_NEIGH_MAX]; | 2563 | struct ctl_table neigh_vars[NEIGH_VARS_MAX]; |
2562 | char *dev_name; | 2564 | char *dev_name; |
2563 | } neigh_sysctl_template __read_mostly = { | 2565 | } neigh_sysctl_template __read_mostly = { |
2564 | .neigh_vars = { | 2566 | .neigh_vars = { |
@@ -2675,8 +2677,7 @@ static struct neigh_sysctl_table { | |||
2675 | }; | 2677 | }; |
2676 | 2678 | ||
2677 | int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, | 2679 | int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, |
2678 | int p_id, int pdev_id, char *p_name, | 2680 | char *p_name, proc_handler *handler) |
2679 | proc_handler *handler) | ||
2680 | { | 2681 | { |
2681 | struct neigh_sysctl_table *t; | 2682 | struct neigh_sysctl_table *t; |
2682 | const char *dev_name_source = NULL; | 2683 | const char *dev_name_source = NULL; |
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 1940b4df7699..c4dd13542802 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
@@ -1284,8 +1284,7 @@ void __init arp_init(void) | |||
1284 | dev_add_pack(&arp_packet_type); | 1284 | dev_add_pack(&arp_packet_type); |
1285 | arp_proc_init(); | 1285 | arp_proc_init(); |
1286 | #ifdef CONFIG_SYSCTL | 1286 | #ifdef CONFIG_SYSCTL |
1287 | neigh_sysctl_register(NULL, &arp_tbl.parms, NET_IPV4, | 1287 | neigh_sysctl_register(NULL, &arp_tbl.parms, "ipv4", NULL); |
1288 | NET_IPV4_NEIGH, "ipv4", NULL); | ||
1289 | #endif | 1288 | #endif |
1290 | register_netdevice_notifier(&arp_netdev_notifier); | 1289 | register_netdevice_notifier(&arp_netdev_notifier); |
1291 | } | 1290 | } |
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index b1eddee9bf94..014982b61564 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -1487,8 +1487,7 @@ static void __devinet_sysctl_unregister(struct ipv4_devconf *cnf) | |||
1487 | 1487 | ||
1488 | static void devinet_sysctl_register(struct in_device *idev) | 1488 | static void devinet_sysctl_register(struct in_device *idev) |
1489 | { | 1489 | { |
1490 | neigh_sysctl_register(idev->dev, idev->arp_parms, NET_IPV4, | 1490 | neigh_sysctl_register(idev->dev, idev->arp_parms, "ipv4", NULL); |
1491 | NET_IPV4_NEIGH, "ipv4", NULL); | ||
1492 | __devinet_sysctl_register(dev_net(idev->dev), idev->dev->name, | 1491 | __devinet_sysctl_register(dev_net(idev->dev), idev->dev->name, |
1493 | &idev->cnf); | 1492 | &idev->cnf); |
1494 | } | 1493 | } |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 764ad37ca070..c79cbff54370 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -4416,8 +4416,7 @@ static void __addrconf_sysctl_unregister(struct ipv6_devconf *p) | |||
4416 | 4416 | ||
4417 | static void addrconf_sysctl_register(struct inet6_dev *idev) | 4417 | static void addrconf_sysctl_register(struct inet6_dev *idev) |
4418 | { | 4418 | { |
4419 | neigh_sysctl_register(idev->dev, idev->nd_parms, NET_IPV6, | 4419 | neigh_sysctl_register(idev->dev, idev->nd_parms, "ipv6", |
4420 | NET_IPV6_NEIGH, "ipv6", | ||
4421 | &ndisc_ifinfo_sysctl_change); | 4420 | &ndisc_ifinfo_sysctl_change); |
4422 | __addrconf_sysctl_register(dev_net(idev->dev), idev->dev->name, | 4421 | __addrconf_sysctl_register(dev_net(idev->dev), idev->dev->name, |
4423 | idev, &idev->cnf); | 4422 | idev, &idev->cnf); |
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 2dfec6bb8ada..8bcc4b7db3bf 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -1820,8 +1820,7 @@ int __init ndisc_init(void) | |||
1820 | neigh_table_init(&nd_tbl); | 1820 | neigh_table_init(&nd_tbl); |
1821 | 1821 | ||
1822 | #ifdef CONFIG_SYSCTL | 1822 | #ifdef CONFIG_SYSCTL |
1823 | err = neigh_sysctl_register(NULL, &nd_tbl.parms, NET_IPV6, | 1823 | err = neigh_sysctl_register(NULL, &nd_tbl.parms, "ipv6", |
1824 | NET_IPV6_NEIGH, "ipv6", | ||
1825 | &ndisc_ifinfo_sysctl_change); | 1824 | &ndisc_ifinfo_sysctl_change); |
1826 | if (err) | 1825 | if (err) |
1827 | goto out_unregister_pernet; | 1826 | goto out_unregister_pernet; |