[PATCH] [IPROUTE2] Add support for moving links between network namespaces

2007-09-12 Thread Eric W. Biederman

This adds support for setting the IFLA_NET_NS_PID attribute
on links allowing them to be moved between network namespaces.

Signed-off-by: Eric W. Biederman [EMAIL PROTECTED]
---
 include/linux/if_link.h |1 +
 ip/iplink.c |9 +
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 23b3a8e..c948395 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -78,6 +78,7 @@ enum
IFLA_LINKMODE,
IFLA_LINKINFO,
 #define IFLA_LINKINFO IFLA_LINKINFO
+   IFLA_NET_NS_PID,
__IFLA_MAX
 };
 
diff --git a/ip/iplink.c b/ip/iplink.c
index 541f3d6..624c784 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -158,6 +158,7 @@ int iplink_parse(int argc, char **argv, struct iplink_req 
*req,
char abuf[32];
int qlen = -1;
int mtu = -1;
+   pid_t netns_pid = -1;
 
ret = argc;
 
@@ -255,6 +256,14 @@ int iplink_parse(int argc, char **argv, struct iplink_req 
*req,
} else
return on_off(dynamic);
 #endif
+   } else if (matches(*argv, netnspid) == 0) {
+   NEXT_ARG();
+   if (netns_pid != -1)
+   duparg(netnspid, *argv);
+   if (get_integer(netns_pid, *argv, 0))
+   invarg(Invalid \netnspid\ value\n, *argv);
+   addattr_l(req-n, sizeof(*req), IFLA_NET_NS_PID,
+   netns_pid, sizeof(netns_pid));
} else if (matches(*argv, type) == 0) {
NEXT_ARG();
*type = *argv;
-- 
1.5.3.rc6.17.g1911

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [IPROUTE2] Add support for moving links between network namespaces

2007-09-12 Thread Stephen Hemminger
On Wed, 12 Sep 2007 07:05:42 -0600
[EMAIL PROTECTED] (Eric W. Biederman) wrote:

 
 This adds support for setting the IFLA_NET_NS_PID attribute
 on links allowing them to be moved between network namespaces.
 
 Signed-off-by: Eric W. Biederman [EMAIL PROTECTED]
 ---
  include/linux/if_link.h |1 +
  ip/iplink.c |9 +
  2 files changed, 10 insertions(+), 0 deletions(-)

Please don't mix header file updates with command changes.
As a first step, I always install standard kernel santized headers.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [IPROUTE2] Add support for moving links between network namespaces

2007-09-12 Thread Eric W. Biederman
Stephen Hemminger [EMAIL PROTECTED] writes:

 On Wed, 12 Sep 2007 07:05:42 -0600
 [EMAIL PROTECTED] (Eric W. Biederman) wrote:

 
 This adds support for setting the IFLA_NET_NS_PID attribute
 on links allowing them to be moved between network namespaces.
 
 Signed-off-by: Eric W. Biederman [EMAIL PROTECTED]
 ---
  include/linux/if_link.h |1 +
  ip/iplink.c |9 +
  2 files changed, 10 insertions(+), 0 deletions(-)

 Please don't mix header file updates with command changes.
 As a first step, I always install standard kernel santized headers.

Sorry I didn't know.  Those changes are now in net-2.6.24
so installing sanitized headers should not change anything.

In please feel free to drop the if_link.h part, and if you want
I can resend that patch with those few lines deleted.

Eric
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [IPROUTE2] Add support for moving links between network namespaces

2007-09-12 Thread Stephen Hemminger
On Wed, 12 Sep 2007 08:06:08 -0600
[EMAIL PROTECTED] (Eric W. Biederman) wrote:

 Stephen Hemminger [EMAIL PROTECTED] writes:
 
  On Wed, 12 Sep 2007 07:05:42 -0600
  [EMAIL PROTECTED] (Eric W. Biederman) wrote:
 
  
  This adds support for setting the IFLA_NET_NS_PID attribute
  on links allowing them to be moved between network namespaces.
  
  Signed-off-by: Eric W. Biederman [EMAIL PROTECTED]
  ---
   include/linux/if_link.h |1 +
   ip/iplink.c |9 +
   2 files changed, 10 insertions(+), 0 deletions(-)
 
  Please don't mix header file updates with command changes.
  As a first step, I always install standard kernel santized headers.
 
 Sorry I didn't know.  Those changes are now in net-2.6.24
 so installing sanitized headers should not change anything.
 
 In please feel free to drop the if_link.h part, and if you want
 I can resend that patch with those few lines deleted.
 
 Eric

I take care of fixing patches (as long as they aren't really damaged).
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html