* [PATCH Iproute2 next] ip netns: 'ip netns id' cmd without argument should not give error
@ 2014-12-19 6:05 Mahesh Bandewar
2014-12-19 8:31 ` Vadim Kochan
0 siblings, 1 reply; 3+ messages in thread
From: Mahesh Bandewar @ 2014-12-19 6:05 UTC (permalink / raw)
To: netdev, Stephen Hemminger; +Cc: Vadim Kochan, Saied Kazemi, 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 <maheshb@google.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: Vadim Kochan <vadim4j@gmail.com>
Cc: Saied Kazemi <saied@google.com>
---
ip/ipnetns.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ip/ipnetns.c b/ip/ipnetns.c
index 1c8aa029073e..ec9afa2177a5 100644
--- a/ip/ipnetns.c
+++ b/ip/ipnetns.c
@@ -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");
--
2.2.0.rc0.207.ga3a616c
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH Iproute2 next] ip netns: 'ip netns id' cmd without argument should not give error
2014-12-19 6:05 [PATCH Iproute2 next] ip netns: 'ip netns id' cmd without argument should not give error Mahesh Bandewar
@ 2014-12-19 8:31 ` Vadim Kochan
2014-12-19 18:33 ` Mahesh Bandewar
0 siblings, 1 reply; 3+ messages in thread
From: Vadim Kochan @ 2014-12-19 8:31 UTC (permalink / raw)
To: Mahesh Bandewar; +Cc: netdev, Stephen Hemminger, Vadim Kochan, Saied Kazemi
On Thu, Dec 18, 2014 at 10:05:38PM -0800, Mahesh Bandewar wrote:
> 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 <maheshb@google.com>
> Cc: Stephen Hemminger <stephen@networkplumber.org>
> Cc: Vadim Kochan <vadim4j@gmail.com>
> Cc: Saied Kazemi <saied@google.com>
> ---
> ip/ipnetns.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/ip/ipnetns.c b/ip/ipnetns.c
> index 1c8aa029073e..ec9afa2177a5 100644
> --- a/ip/ipnetns.c
> +++ b/ip/ipnetns.c
> @@ -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");
> --
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH Iproute2 next] ip netns: 'ip netns id' cmd without argument should not give error
2014-12-19 8:31 ` Vadim Kochan
@ 2014-12-19 18:33 ` Mahesh Bandewar
0 siblings, 0 replies; 3+ messages in thread
From: Mahesh Bandewar @ 2014-12-19 18:33 UTC (permalink / raw)
To: Vadim Kochan; +Cc: netdev, Stephen Hemminger, Saied Kazemi
On Fri, Dec 19, 2014 at 12:31 AM, Vadim Kochan <vadim4j@gmail.com> wrote:
> On Thu, Dec 18, 2014 at 10:05:38PM -0800, Mahesh Bandewar wrote:
>> 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 <maheshb@google.com>
>> Cc: Stephen Hemminger <stephen@networkplumber.org>
>> Cc: Vadim Kochan <vadim4j@gmail.com>
>> Cc: Saied Kazemi <saied@google.com>
>> ---
>> ip/ipnetns.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/ip/ipnetns.c b/ip/ipnetns.c
>> index 1c8aa029073e..ec9afa2177a5 100644
>> --- a/ip/ipnetns.c
>> +++ b/ip/ipnetns.c
>> @@ -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");
>> --
>> 2.2.0.rc0.207.ga3a616c
>>
>
> Hi Mahesh,
>
> 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!
> Regards,
> Vadim Kochan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-12-19 18:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-19 6:05 [PATCH Iproute2 next] ip netns: 'ip netns id' cmd without argument should not give error Mahesh Bandewar
2014-12-19 8:31 ` Vadim Kochan
2014-12-19 18:33 ` Mahesh Bandewar
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).