netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][IPROUTE2] Support device movement between network namespaces
       [not found] <20080424151528.746600079@theryb.frec.bull.fr>
@ 2008-04-24 15:15 ` Benjamin Thery
  2008-06-04 11:27   ` Eric W. Biederman
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Thery @ 2008-04-24 15:15 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Daniel Lezcano, netdev

Hi Stephen,

I don't know if anyone has already sent you this patch for iproute2 to
enable movement of network devices between network namespaces. 
(Daniel Lezcano is the original author). 

It applies on iproute2-2.6.25.

Benjamin


This patch adds support for the IFLA_NET_NS_PID type used to move 
network devices between network namespaces.

The syntax is: 
ip link DEVICE netns PID

PID is the pid of a process in the target network namespace.

---
 ip/iplink.c |    9 +++++++++
 1 file changed, 9 insertions(+)

Index: iproute2-2.6.25/ip/iplink.c
===================================================================
--- iproute2-2.6.25.orig/ip/iplink.c
+++ iproute2-2.6.25/ip/iplink.c
@@ -49,6 +49,7 @@ void iplink_usage(void)
 	fprintf(stderr, "	                     name NEWNAME |\n");
 	fprintf(stderr, "	                     address LLADDR | broadcast LLADDR |\n");
 	fprintf(stderr, "	                     mtu MTU }\n");
+	fprintf(stderr, "	                     netns PID }\n");
 	fprintf(stderr, "       ip link show [ DEVICE ]\n");
 	exit(-1);
 }
@@ -156,6 +157,7 @@ int iplink_parse(int argc, char **argv, 
 	char abuf[32];
 	int qlen = -1;
 	int mtu = -1;
+	int netns = -1;
 
 	ret = argc;
 
@@ -197,6 +199,13 @@ int iplink_parse(int argc, char **argv, 
 			if (get_integer(&mtu, *argv, 0))
 				invarg("Invalid \"mtu\" value\n", *argv);
 			addattr_l(&req->n, sizeof(*req), IFLA_MTU, &mtu, 4);
+                } else if (strcmp(*argv, "netns") == 0) {
+                        NEXT_ARG();
+                        if (netns != -1)
+                                duparg("netns", *argv);
+                        if (get_integer(&netns, *argv, 0))
+                                invarg("Invalid \"netns\" value\n", *argv);
+                        addattr_l(&req->n, sizeof(*req), IFLA_NET_NS_PID, &netns, 4);
 		} else if (strcmp(*argv, "multicast") == 0) {
 			NEXT_ARG();
 			req->i.ifi_change |= IFF_MULTICAST;

-- 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][IPROUTE2] Support device movement between network namespaces
  2008-04-24 15:15 ` [PATCH][IPROUTE2] Support device movement between network namespaces Benjamin Thery
@ 2008-06-04 11:27   ` Eric W. Biederman
  0 siblings, 0 replies; 2+ messages in thread
From: Eric W. Biederman @ 2008-06-04 11:27 UTC (permalink / raw)
  To: Benjamin Thery; +Cc: Stephen Hemminger, Daniel Lezcano, netdev

Benjamin Thery <benjamin.thery@bull.net> writes:

> Hi Stephen,
>
> I don't know if anyone has already sent you this patch for iproute2 to
> enable movement of network devices between network namespaces. 
> (Daniel Lezcano is the original author). 
>
> It applies on iproute2-2.6.25.
>
> Benjamin
>
>
> This patch adds support for the IFLA_NET_NS_PID type used to move 
> network devices between network namespaces.
>
> The syntax is: 
> ip link DEVICE netns PID
>
> PID is the pid of a process in the target network namespace.

Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>

It does not look like this patch has been merged?
Is the queue just slow right now? Or is there some particular reason?

Eric

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-06-04 11:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20080424151528.746600079@theryb.frec.bull.fr>
2008-04-24 15:15 ` [PATCH][IPROUTE2] Support device movement between network namespaces Benjamin Thery
2008-06-04 11:27   ` Eric W. Biederman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).