diff mbox series

[iproute2,v2,2/2] iplink: fix help of 'netns' arg

Message ID 20230420084849.21506-3-nicolas.dichtel@6wind.com (mailing list archive)
State Superseded
Delegated to: David Ahern
Headers show
Series iplink: update doc related to the 'netns' arg | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Nicolas Dichtel April 20, 2023, 8:48 a.m. UTC
'ip link set foo netns /proc/1/ns/net' is a valid command.
Let's update the doc accordingly.

Fixes: 0dc34c7713bb ("iproute2: Add processless network namespace support")
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 ip/iplink.c           |  4 ++--
 man/man8/ip-link.8.in | 10 ++++++----
 2 files changed, 8 insertions(+), 6 deletions(-)

Comments

Simon Horman April 20, 2023, 11:27 a.m. UTC | #1
On Thu, Apr 20, 2023 at 10:48:49AM +0200, Nicolas Dichtel wrote:
> [You don't often get email from nicolas.dichtel@6wind.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> 'ip link set foo netns /proc/1/ns/net' is a valid command.
> Let's update the doc accordingly.
> 
> Fixes: 0dc34c7713bb ("iproute2: Add processless network namespace support")
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> ---
>  ip/iplink.c           |  4 ++--
>  man/man8/ip-link.8.in | 10 ++++++----
>  2 files changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/ip/iplink.c b/ip/iplink.c
> index 8755fa076dab..9ac3b8cb2ad5 100644
> --- a/ip/iplink.c
> +++ b/ip/iplink.c
> @@ -63,7 +63,7 @@ void iplink_usage(void)
>                         "                   [ mtu MTU ] [index IDX ]\n"
>                         "                   [ numtxqueues QUEUE_COUNT ]\n"
>                         "                   [ numrxqueues QUEUE_COUNT ]\n"
> -                       "                   [ netns { PID | NETNSNAME } ]\n"
> +                       "                   [ netns { PID | NETNSNAME | NETNSFILE } ]\n"
>                         "                   type TYPE [ ARGS ]\n"
>                         "\n"
>                         "       ip link delete { DEVICE | dev DEVICE | group DEVGROUP } type TYPE [ ARGS ]\n"
> @@ -88,7 +88,7 @@ void iplink_usage(void)
>                 "               [ address LLADDR ]\n"
>                 "               [ broadcast LLADDR ]\n"
>                 "               [ mtu MTU ]\n"
> -               "               [ netns { PID | NETNSNAME } ]\n"
> +               "               [ netns { PID | NETNSNAME | NETNSFILE } ]\n"
>                 "               [ link-netns NAME | link-netnsid ID ]\n"
>                 "               [ alias NAME ]\n"
>                 "               [ vf NUM [ mac LLADDR ]\n"
> diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
> index a4e0c4030363..59deaa2c1263 100644
> --- a/man/man8/ip-link.8.in
> +++ b/man/man8/ip-link.8.in
> @@ -49,7 +49,7 @@ ip-link \- network device configuration
>  .IR BYTES " ]"
>  .br
>  .RB "[ " netns " {"
> -.IR PID " | " NETNSNAME " } ]"
> +.IR PID " | " NETNSNAME " | " NETNSFILE " } ]"
>  .br
>  .BI type " TYPE"
>  .RI "[ " ARGS " ]"
> @@ -118,7 +118,7 @@ ip-link \- network device configuration
>  .IR MTU " ]"
>  .br
>  .RB "[ " netns " {"
> -.IR PID " | " NETNSNAME " } ]"
> +.IR PID " | " NETNSNAME " | " NETNSFILE " } ]"
>  .br
>  .RB "[ " link-netnsid
>  .IR ID " ]"
> @@ -465,7 +465,7 @@ specifies the desired index of the new virtual device. The link
>  creation fails, if the index is busy.
> 
>  .TP
> -.BI netns " { PID | NETNSNAME } "
> +.BI netns " { PID | NETNSNAME | NETNSFILE } "
>  specifies the desired network namespace to create interface in.
> 
>  .TP
> @@ -2188,9 +2188,11 @@ the interface is
>  .IR "POINTOPOINT" .
> 
>  .TP
> -.BI netns " NETNSNAME " \fR| " PID"
> +.BI netns " NETNSNAME " \fR| " NETNSFILE " \fR| " PID"

nit: The text in this and the previous hunk was and is inconsistent.
     Is that something that could be addressed (at some point) ?

>  move the device to the network namespace associated with name
>  .IR "NETNSNAME " or
> +the file
> +.IR "NETNSFILE " or
>  .RI process " PID".
> 
>  Some devices are not allowed to change network namespace: loopback, bridge,
> --
> 2.39.2
>
Nicolas Dichtel April 20, 2023, 3 p.m. UTC | #2
Le 20/04/2023 à 13:27, Simon Horman a écrit :
[snip]
> nit: The text in this and the previous hunk was and is inconsistent.
>      Is that something that could be addressed (at some point) ?

I will send a v3. Just waiting a bit in case there are more comments.


Regards,
Nicolas
diff mbox series

Patch

diff --git a/ip/iplink.c b/ip/iplink.c
index 8755fa076dab..9ac3b8cb2ad5 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -63,7 +63,7 @@  void iplink_usage(void)
 			"		    [ mtu MTU ] [index IDX ]\n"
 			"		    [ numtxqueues QUEUE_COUNT ]\n"
 			"		    [ numrxqueues QUEUE_COUNT ]\n"
-			"		    [ netns { PID | NETNSNAME } ]\n"
+			"		    [ netns { PID | NETNSNAME | NETNSFILE } ]\n"
 			"		    type TYPE [ ARGS ]\n"
 			"\n"
 			"	ip link delete { DEVICE | dev DEVICE | group DEVGROUP } type TYPE [ ARGS ]\n"
@@ -88,7 +88,7 @@  void iplink_usage(void)
 		"		[ address LLADDR ]\n"
 		"		[ broadcast LLADDR ]\n"
 		"		[ mtu MTU ]\n"
-		"		[ netns { PID | NETNSNAME } ]\n"
+		"		[ netns { PID | NETNSNAME | NETNSFILE } ]\n"
 		"		[ link-netns NAME | link-netnsid ID ]\n"
 		"		[ alias NAME ]\n"
 		"		[ vf NUM [ mac LLADDR ]\n"
diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
index a4e0c4030363..59deaa2c1263 100644
--- a/man/man8/ip-link.8.in
+++ b/man/man8/ip-link.8.in
@@ -49,7 +49,7 @@  ip-link \- network device configuration
 .IR BYTES " ]"
 .br
 .RB "[ " netns " {"
-.IR PID " | " NETNSNAME " } ]"
+.IR PID " | " NETNSNAME " | " NETNSFILE " } ]"
 .br
 .BI type " TYPE"
 .RI "[ " ARGS " ]"
@@ -118,7 +118,7 @@  ip-link \- network device configuration
 .IR MTU " ]"
 .br
 .RB "[ " netns " {"
-.IR PID " | " NETNSNAME " } ]"
+.IR PID " | " NETNSNAME " | " NETNSFILE " } ]"
 .br
 .RB "[ " link-netnsid
 .IR ID " ]"
@@ -465,7 +465,7 @@  specifies the desired index of the new virtual device. The link
 creation fails, if the index is busy.
 
 .TP
-.BI netns " { PID | NETNSNAME } "
+.BI netns " { PID | NETNSNAME | NETNSFILE } "
 specifies the desired network namespace to create interface in.
 
 .TP
@@ -2188,9 +2188,11 @@  the interface is
 .IR "POINTOPOINT" .
 
 .TP
-.BI netns " NETNSNAME " \fR| " PID"
+.BI netns " NETNSNAME " \fR| " NETNSFILE " \fR| " PID"
 move the device to the network namespace associated with name
 .IR "NETNSNAME " or
+the file
+.IR "NETNSFILE " or
 .RI process " PID".
 
 Some devices are not allowed to change network namespace: loopback, bridge,