* [PATCH] iproute2: add support for IFLA_NET_NS_PID in ip link
[not found] <20080620090725.818393362@theryb.frec.bull.fr>
@ 2008-06-20 9:07 ` Benjamin Thery
2008-06-20 9:21 ` [PATCH] iproute2: add support for IFLA_NET_NS_PID in ip link v2 Benjamin Thery
0 siblings, 1 reply; 5+ messages in thread
From: Benjamin Thery @ 2008-06-20 9:07 UTC (permalink / raw)
To: Stephen Hemminger
Cc: Daniel Lezcano, Eric W. Biederman, Benjamin Thery, netdev
Hi Stephen,
I resend you this patch once more. This time I updated the documentation
too (may be that was the reason why you didn't take it before?).
Please tell me if there are other things missing in this patch
It applies on iproute2 git tree.
Regards,
Benjamin
Description:
------------
This patch adds support for the IFLA_NET_NS_PID type. It is used to
move network devices between network namespaces.
The syntax is:
ip link set DEVICE netns PID
PID is the pid of a process in the target network namespace.
(Daniel Lezcano is the original author).
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Benjamin Thery <benjamin.thery@bull.net>
---
doc/ip-cref.tex | 4 ++++
ip/iplink.c | 9 +++++++++
man/man8/ip.8 | 10 +++++++++-
3 files changed, 22 insertions(+), 1 deletion(-)
Index: iproute2/doc/ip-cref.tex
===================================================================
--- iproute2.orig/doc/ip-cref.tex
+++ iproute2/doc/ip-cref.tex
@@ -294,6 +294,10 @@ broadcast address will break networking.
Do not use it, if you do not understand what this operation really does.
\end{NB}
+\item \verb|netns PID|
+
+--- move the device to the network namespace associated with the process PID.
+
\end{itemize}
\vskip 1mm
Index: iproute2/ip/iplink.c
===================================================================
--- iproute2.orig/ip/iplink.c
+++ iproute2/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;
Index: iproute2/man/man8/ip.8
===================================================================
--- iproute2.orig/man/man8/ip.8
+++ iproute2/man/man8/ip.8
@@ -50,7 +50,10 @@ ip \- show / manipulate routing, devices
.IR LLADDR " |"
.br
.B mtu
-.IR MTU " }"
+.IR MTU " |"
+.br
+.B netns
+.IR PID " }"
.ti -8
.B ip link show
@@ -873,6 +876,11 @@ change the link layer broadcast address
the interface is
.IR "POINTOPOINT" .
+.TP
+.BI netns " PID"
+move the device to the network namespace associated with the process
+.IR "PID" .
+
.PP
.B Warning:
If multiple parameter changes are requested,
--
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] iproute2: add support for IFLA_NET_NS_PID in ip link v2
2008-06-20 9:07 ` [PATCH] iproute2: add support for IFLA_NET_NS_PID in ip link Benjamin Thery
@ 2008-06-20 9:21 ` Benjamin Thery
2008-06-23 8:08 ` Daniel Lezcano
0 siblings, 1 reply; 5+ messages in thread
From: Benjamin Thery @ 2008-06-20 9:21 UTC (permalink / raw)
To: Stephen Hemminger
Cc: netdev, Daniel Lezcano, Eric W. Biederman, Benjamin Thery
Ah, ah, of course I forgot to refresh the patch before sending it. :)
There was still a small typo in the patch: a '}' was put instead of
a '|' in 'ip link' usage string.
Here is the updated patch.
Sorry for this.
Benjamin
Description:
------------
This patch adds support for the IFLA_NET_NS_PID type. It is used to
move network devices between network namespaces.
The syntax is:
ip link set DEVICE netns PID
PID is the pid of a process in the target network namespace.
(Daniel Lezcano is the original author).
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Benjamin Thery <benjamin.thery@bull.net>
---
doc/ip-cref.tex | 4 ++++
ip/iplink.c | 11 ++++++++++-
man/man8/ip.8 | 10 +++++++++-
3 files changed, 23 insertions(+), 2 deletions(-)
Index: iproute2/doc/ip-cref.tex
===================================================================
--- iproute2.orig/doc/ip-cref.tex
+++ iproute2/doc/ip-cref.tex
@@ -294,6 +294,10 @@ broadcast address will break networking.
Do not use it, if you do not understand what this operation really does.
\end{NB}
+\item \verb|netns PID|
+
+--- move the device to the network namespace associated with the process PID.
+
\end{itemize}
\vskip 1mm
Index: iproute2/ip/iplink.c
===================================================================
--- iproute2.orig/ip/iplink.c
+++ iproute2/ip/iplink.c
@@ -48,7 +48,8 @@ void iplink_usage(void)
fprintf(stderr, " txqueuelen PACKETS |\n");
fprintf(stderr, " name NEWNAME |\n");
fprintf(stderr, " address LLADDR | broadcast LLADDR |\n");
- fprintf(stderr, " mtu MTU }\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;
Index: iproute2/man/man8/ip.8
===================================================================
--- iproute2.orig/man/man8/ip.8
+++ iproute2/man/man8/ip.8
@@ -50,7 +50,10 @@ ip \- show / manipulate routing, devices
.IR LLADDR " |"
.br
.B mtu
-.IR MTU " }"
+.IR MTU " |"
+.br
+.B netns
+.IR PID " }"
.ti -8
.B ip link show
@@ -873,6 +876,11 @@ change the link layer broadcast address
the interface is
.IR "POINTOPOINT" .
+.TP
+.BI netns " PID"
+move the device to the network namespace associated with the process
+.IR "PID" .
+
.PP
.B Warning:
If multiple parameter changes are requested,
--
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iproute2: add support for IFLA_NET_NS_PID in ip link v2
2008-06-20 9:21 ` [PATCH] iproute2: add support for IFLA_NET_NS_PID in ip link v2 Benjamin Thery
@ 2008-06-23 8:08 ` Daniel Lezcano
2008-06-23 16:02 ` Stephen Hemminger
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Lezcano @ 2008-06-23 8:08 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Benjamin Thery, netdev, Eric W. Biederman
Benjamin Thery wrote:
> Ah, ah, of course I forgot to refresh the patch before sending it. :)
> There was still a small typo in the patch: a '}' was put instead of
> a '|' in 'ip link' usage string.
>
> Here is the updated patch.
> Sorry for this.
>
> Benjamin
>
> Description:
> ------------
>
> This patch adds support for the IFLA_NET_NS_PID type. It is used to
> move network devices between network namespaces.
>
> The syntax is:
> ip link set DEVICE netns PID
>
> PID is the pid of a process in the target network namespace.
>
> (Daniel Lezcano is the original author).
>
> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
> Signed-off-by: Benjamin Thery <benjamin.thery@bull.net>
Hi Stephen,
we posted this patch several times and we had no response.
I suppose you are very busy and you had no time to answer.
Can you briefly tell us what do you plan to do with this patch ?
Thanks
-- Daniel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iproute2: add support for IFLA_NET_NS_PID in ip link v2
2008-06-23 8:08 ` Daniel Lezcano
@ 2008-06-23 16:02 ` Stephen Hemminger
2008-06-24 9:35 ` Daniel Lezcano
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2008-06-23 16:02 UTC (permalink / raw)
To: Daniel Lezcano; +Cc: Benjamin Thery, netdev, Eric W. Biederman
On Mon, 23 Jun 2008 10:08:13 +0200
Daniel Lezcano <dlezcano@fr.ibm.com> wrote:
> Benjamin Thery wrote:
> > Ah, ah, of course I forgot to refresh the patch before sending it. :)
> > There was still a small typo in the patch: a '}' was put instead of
> > a '|' in 'ip link' usage string.
> >
> > Here is the updated patch.
> > Sorry for this.
> >
> > Benjamin
> >
> > Description:
> > ------------
> >
> > This patch adds support for the IFLA_NET_NS_PID type. It is used to
> > move network devices between network namespaces.
> >
> > The syntax is:
> > ip link set DEVICE netns PID
> >
> > PID is the pid of a process in the target network namespace.
> >
> > (Daniel Lezcano is the original author).
> >
> > Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
> > Signed-off-by: Benjamin Thery <benjamin.thery@bull.net>
>
> Hi Stephen,
>
> we posted this patch several times and we had no response.
> I suppose you are very busy and you had no time to answer.
> Can you briefly tell us what do you plan to do with this patch ?
>
>
> Thanks
> -- Daniel
>
I am doing a new release. It is in the list of things to go in.
But was holding off until other issues resolved. It will go in today.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iproute2: add support for IFLA_NET_NS_PID in ip link v2
2008-06-23 16:02 ` Stephen Hemminger
@ 2008-06-24 9:35 ` Daniel Lezcano
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Lezcano @ 2008-06-24 9:35 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Benjamin Thery, netdev, Eric W. Biederman
Stephen Hemminger wrote:
> On Mon, 23 Jun 2008 10:08:13 +0200
> Daniel Lezcano <dlezcano@fr.ibm.com> wrote:
>
>> Benjamin Thery wrote:
>>> Ah, ah, of course I forgot to refresh the patch before sending it. :)
>>> There was still a small typo in the patch: a '}' was put instead of
>>> a '|' in 'ip link' usage string.
>>>
>>> Here is the updated patch.
>>> Sorry for this.
>>>
>>> Benjamin
>>>
>>> Description:
>>> ------------
>>>
>>> This patch adds support for the IFLA_NET_NS_PID type. It is used to
>>> move network devices between network namespaces.
>>>
>>> The syntax is:
>>> ip link set DEVICE netns PID
>>>
>>> PID is the pid of a process in the target network namespace.
>>>
>>> (Daniel Lezcano is the original author).
>>>
>>> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
>>> Signed-off-by: Benjamin Thery <benjamin.thery@bull.net>
>> Hi Stephen,
>>
>> we posted this patch several times and we had no response.
>> I suppose you are very busy and you had no time to answer.
>> Can you briefly tell us what do you plan to do with this patch ?
>>
>>
>> Thanks
>> -- Daniel
>>
> I am doing a new release. It is in the list of things to go in.
> But was holding off until other issues resolved. It will go in today.
Thanks Stephen.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-06-24 9:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20080620090725.818393362@theryb.frec.bull.fr>
2008-06-20 9:07 ` [PATCH] iproute2: add support for IFLA_NET_NS_PID in ip link Benjamin Thery
2008-06-20 9:21 ` [PATCH] iproute2: add support for IFLA_NET_NS_PID in ip link v2 Benjamin Thery
2008-06-23 8:08 ` Daniel Lezcano
2008-06-23 16:02 ` Stephen Hemminger
2008-06-24 9:35 ` Daniel Lezcano
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).