OpenVZ Forum - RDF feed
type: channel
items: [patch 34/38][IPV6] addrconf - Pass the proper network namespace parameters to addrconf

[patch 34/38][IPV6] addrconf - Pass the proper network namespace parameters to addrconf
type: item
description: This patch propagateis the network namespace pointer to the functions which need it, which means adding a new parameter to these functions, and make them use it instead of using the initial network namespace. Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com> Signed-off-by: Benjamin Thery <benjamin.thery@bull.net> --- include/net/addrconf.h | 9 ++++--- net/ipv6/addrconf.c | 63 +++++++++++++++++++++++++++++++++++-------------- net/ipv6/af_inet6.c | 6 ++-- 3 files changed, 54 insertions(+), 24 deletions(-) Index: linux-2.6-netns/include/net/addrconf.h =================================================================== --- linux-2.6-netns.orig/include/net/addrconf.h +++ linux-2.6-netns/include/net/addrconf.h @@ -54,9 +54,12 @@ struct prefix_info { extern int addrconf_init(void); extern void addrconf_cleanup(void); -extern int addrconf_add_ifaddr(void __user *arg); -extern int addrconf_del_ifaddr(void __user *arg); -extern int addrconf_set_dstaddr(void __user *arg); +extern int addrconf_add_ifaddr(struct net *net, + void __user *arg); +extern int addrconf_del_ifaddr(struct net *net, + void __user *arg); +extern int addrconf_set_dstaddr(struct net *net, + void __user *arg); extern int ipv6_chk_addr(struct net *net, struct in6_addr *addr, Index: linux-2.6-netns/net/ipv6/addrconf.c =================================================================== --- linux-2.6-netns.orig/net/ipv6/addrconf.c +++ linux-2.6-netns/net/ipv6/addrconf.c @@ -1847,7 +1847,7 @@ ok: * Special case for SIT interfaces where we create a new "virtual" * device. */ -int addrconf_set_dstaddr(void __user *arg) +int addrconf_set_dstaddr(struct net *net, void __user *arg) { struct in6_ifreq ireq; struct net_device *dev; @@ -1859,7 +1859,7 @@ int addrconf_set_dstaddr(void __user *ar if (copy_from_user(&ireq, arg, sizeof(struct in6_ifreq))) goto err_exit; - dev = __dev_get_by_index(&init_net, ireq.ifr6_ifindex); + dev = __dev_get_by_index(net, ireq.ifr6_ifindex); err = -ENODEV; if (dev == NULL) @@ -1890,7 +1…
creator: Daniel Lezcano
date: 2007-12-03T16:17:10-00:00