ip netns: 'ip netns id' cmd without argument should not give error
Subsystems (2)
PATCH 1/1 ip netns: 'ip netns id' cmd without argument should not give error
The command 'ip netns identify' without PID parameter is supposed to use the self PID to identify its ns but a trivial error prevented it from doing so. This patch fixes that error.
So before the patch -
# ip netns id No pid specified # echo $? 1 #
After the patch -
# ip netns id test-ns # echo $? 0 #
--- ip/ipnetns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
ip/ipnetns.c +1 -1
@@ -298,7 +298,7 @@ static int netns_identify(int argc, char **argv)DIR *dir;struct dirent *entry; -if (argc <1 ) { +if (!argc) { pidstr ="self" ; }else if (argc >1 ) {fprintf (stderr,"extra arguments specified\n" );
Signature · 1 line
2.2.0.rc0.207.ga3a616c
Quoted 42 lines · Mahesh Bandewar
The command 'ip netns identify' without PID parameter is supposed to use the self PID to identify its ns but a trivial error prevented it from doing so. This patch fixes that error.
So before the patch -
# ip netns id No pid specified # echo $? 1 #After the patch -
# ip netns id test-ns # echo $? 0 #Signed-off-by Mahesh Bandewar <[email protected]>Cc Stephen Hemminger <[email protected]>Cc Vadim Kochan <[email protected]>Cc Saied Kazemi <[email protected]>--- ip/ipnetns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)ip/ipnetns.c +1
-1@@ -298,7 +298,7 @@ static int netns_identify(int argc, char **argv)DIR *dir;struct dirent *entry; -if (argc <1 ) { +if (!argc) { pidstr ="self" ; }else if (argc >1 ) {fprintf (stderr,"extra arguments specified\n" );Signature · 1 line
2.2.0.rc0.207.ga3a616c
Hi Mahesh,
I did not get such error on the current master branch?
Did I miss something ?
Regards,
Vadim Kochan
Quoted 46 lines · Vadim Kochan
Quoted 40 lines · Mahesh Bandewar
The command 'ip netns identify' without PID parameter is supposed to use the self PID to identify its ns but a trivial error prevented it from doing so. This patch fixes that error.
So before the patch -
# ip netns id No pid specified # echo $? 1 #After the patch -
# ip netns id test-ns # echo $? 0 #Signed-off-by Mahesh Bandewar <[email protected]>Cc Stephen Hemminger <[email protected]>Cc Vadim Kochan <[email protected]>Cc Saied Kazemi <[email protected]>--- ip/ipnetns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)ip/ipnetns.c +1
-2@@ -298,7 +298,7 @@ static int netns_identify(int argc, char **argv)DIR *dir;struct dirent *entry; -if (argc <1 ) { +if (!argc) { pidstr ="self" ; }else if (argc >1 ) {fprintf (stderr,"extra arguments specified\n" ); --Quoted 2 lines
2.2.0.rc0.207.ga3a616c
Hi Mahesh,
Quoted 4 lines
I did not get such error on the current master branch?
Did I miss something ?
No you did not! Please ignore this patch. :)
Looks like the tree I was working / using wasn't next and did not have the patch that made it work (in next). I cherry-picked my fix onto the next and sent it. My bad!
Quoted 2 lines
Regards,
Vadim Kochan