From 03c4b6c2fa7364e020a883809475f28e71edb836 Mon Sep 17 00:00:00 2001 From: wolf Date: Sat, 21 Nov 2009 20:28:17 +0000 Subject: [PATCH] net: Support specifying the network namespace upon device creation. There is no good reason to not support userspace specifying the network namespace during device creation, and it makes it easier to create a network device and pass it to a child network namespace with a well known name. We have to be careful to ensure that the target network namespace for the new device exists through the life of the call. To keep that logic clear I have factored out the network namespace grabbing logic into rtnl_link_get_net. In addtion we need to continue to pass the source network namespace to the rtnl_link_ops.newlink method so that we can find the base device source network namespace. From net-next-2.6 commit 81adee47dfb608df3ad0b91d230fb3cef75f0060 adapted for SVN trunk. Signed-off-by: Eric W. Biederman Acked-by: Eric Dumazet git-svn-id: svn://svn.berlios.de//socketcan/trunk@1085 030b6a49-0b11-0410-94ab-b0dab22257f2 --- kernel/2.6/drivers/net/can/dev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/2.6/drivers/net/can/dev.c b/kernel/2.6/drivers/net/can/dev.c index b8edeaa..ac81d20 100644 --- a/kernel/2.6/drivers/net/can/dev.c +++ b/kernel/2.6/drivers/net/can/dev.c @@ -770,8 +770,13 @@ nla_put_failure: return -EMSGSIZE; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) static int can_newlink(struct net_device *dev, struct nlattr *tb[], struct nlattr *data[]) +#else +static int can_newlink(struct net *src_net, struct net_device *dev, + struct nlattr *tb[], struct nlattr *data[]) +#endif { return -EOPNOTSUPP; } -- 2.39.2