From: Jiri Benc <jbenc@redhat•com>
To: Vadim Kochan <vadim4j@gmail•com>
Cc: netdev@vger•kernel.org
Subject: Re: [PATCH iproute2] ip: Simplify executing ip cmd within namespace
Date: Thu, 11 Dec 2014 17:09:28 +0100 [thread overview]
Message-ID: <20141211170928.62c8e637@griffin> (raw)
In-Reply-To: <1418252195-2612-1-git-send-email-vadim4j@gmail.com>
On Thu, 11 Dec 2014 00:56:35 +0200, Vadim Kochan wrote:
> From: Vadim Kochan <vadim4j@gmail•com>
>
> Added new '-ns' option to simplify executing following cmd:
>
> ip netns exec NETNS ip OPTIONS COMMAND OBJECT
>
> to
>
> ip -ns NETNS OPTIONS COMMAND OBJECT
>
> e.g.:
>
> ip -ns vnet0 link add br0 type bridge
This is great! It's a thing that has been bothering me for long time
but never got high enough on my todo list. Thanks for working on this.
However,
> --- a/ip/ip.c
> +++ b/ip/ip.c
> @@ -262,6 +262,12 @@ int main(int argc, char **argv)
> rcvbuf = size;
> } else if (matches(opt, "-help") == 0) {
> usage();
> + } else if (matches(opt, "-ns") == 0) {
> + argc--;
> + argv++;
> + argv[0] = argv[1];
> + argv[1] = basename;
> + return netns_exec(argc, argv);
I very much dislike this. There's no reason to exec another ip binary.
The main reason I wanted the -n (or whatever) option was to speed up
execution of test scripts in environments with hundreds of interfaces
in different net namespaces.
Please just change to the specified netns and continue with interpreting
of the rest of the command line, there's absolutely no reason for doing
the exec.
Thanks,
Jiri
--
Jiri Benc
next prev parent reply other threads:[~2014-12-11 16:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-10 22:56 [PATCH iproute2] ip: Simplify executing ip cmd within namespace Vadim Kochan
2014-12-11 10:58 ` Nicolas Dichtel
2014-12-11 10:57 ` vadim4j
2014-12-11 12:50 ` Nicolas Dichtel
2014-12-11 13:02 ` vadim4j
2014-12-11 16:09 ` Jiri Benc [this message]
2014-12-11 16:33 ` vadim4j
2014-12-11 17:33 ` Marcelo Ricardo Leitner
2014-12-11 18:08 ` Jiri Benc
2014-12-11 18:36 ` Marcelo Ricardo Leitner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141211170928.62c8e637@griffin \
--to=jbenc@redhat$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=vadim4j@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox