Skip to content

Commit

Permalink
net ipv4: Remove the unneeded registration of an empty net/ipv4/neigh
Browse files Browse the repository at this point in the history
sysctl no longer requires explicit creation of directories.  The neigh
directory is always populated with at least a default entry so this
won't cause any user visible changes.

Delete the ipv4_path and the ipv4_skeleton these are no longer needed.

Directly register the ipv4_route_table.

And since I am an idiot remove the header definitions that I should
have removed in the previous patch.

Signed-off-by: Eric W. Biederman <[email protected]>
Acked-by: Pavel Emelyanov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
ebiederm authored and davem330 committed Apr 21, 2012
1 parent a5287ac commit 4e5ca78
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
2 changes: 0 additions & 2 deletions include/net/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,6 @@ extern struct ctl_table *ipv6_icmp_sysctl_init(struct net *net);
extern struct ctl_table *ipv6_route_sysctl_init(struct net *net);
extern int ipv6_sysctl_register(void);
extern void ipv6_sysctl_unregister(void);
extern int ipv6_static_sysctl_register(void);
extern void ipv6_static_sysctl_unregister(void);
#endif

#endif /* _NET_IPV6_H */
19 changes: 1 addition & 18 deletions net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -3344,23 +3344,6 @@ static ctl_table ipv4_route_table[] = {
{ }
};

static struct ctl_table empty[1];

static struct ctl_table ipv4_skeleton[] =
{
{ .procname = "route",
.mode = 0555, .child = ipv4_route_table},
{ .procname = "neigh",
.mode = 0555, .child = empty},
{ }
};

static __net_initdata struct ctl_path ipv4_path[] = {
{ .procname = "net", },
{ .procname = "ipv4", },
{ },
};

static struct ctl_table ipv4_route_flush_table[] = {
{
.procname = "flush",
Expand Down Expand Up @@ -3515,6 +3498,6 @@ int __init ip_rt_init(void)
*/
void __init ip_static_sysctl_init(void)
{
kmemleak_not_leak(register_net_sysctl_table(&init_net, ipv4_path, ipv4_skeleton));
register_net_sysctl(&init_net, "net/ipv4/route", ipv4_route_table);
}
#endif

0 comments on commit 4e5ca78

Please sign in to comment.