diff options
author | Jiri Pirko <jiri@resnulli.us> | 2013-12-07 19:26:55 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-09 20:56:12 -0500 |
commit | 73af614aedd221df8495fc8c9993c50e87f899f2 (patch) | |
tree | 66eaab080b5add40cf2fc06f194d1c808bb2ec60 /net/core/neighbour.c | |
parent | cb5b09c17fe60056bc8f127ffc987d361c40ed4b (diff) | |
download | op-kernel-dev-73af614aedd221df8495fc8c9993c50e87f899f2.zip op-kernel-dev-73af614aedd221df8495fc8c9993c50e87f899f2.tar.gz |
neigh: use tbl->family to distinguish ipv4 from ipv6
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/neighbour.c')
-rw-r--r-- | net/core/neighbour.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 60edd97..65ead08 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -2947,12 +2947,13 @@ static struct neigh_sysctl_table { }; int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, - char *p_name, proc_handler *handler) + proc_handler *handler) { int i; struct neigh_sysctl_table *t; const char *dev_name_source; char neigh_path[ sizeof("net//neigh/") + IFNAMSIZ + IFNAMSIZ ]; + char *p_name; t = kmemdup(&neigh_sysctl_template, sizeof(*t), GFP_KERNEL); if (!t) @@ -2991,6 +2992,17 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, if (neigh_parms_net(p)->user_ns != &init_user_ns) t->neigh_vars[0].procname = NULL; + switch (neigh_parms_family(p)) { + case AF_INET: + p_name = "ipv4"; + break; + case AF_INET6: + p_name = "ipv6"; + break; + default: + BUG(); + } + snprintf(neigh_path, sizeof(neigh_path), "net/%s/neigh/%s", p_name, dev_name_source); t->sysctl_header = |