From: Phil Sutter <phil@nwl.cc>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org, Wilhelm Wijkander <lists@0x5e.se>,
Vadim Kochan <vadim4j@gmail.com>
Subject: [iproute2 PATCH] ip-link: do not support 'ip link add dev help'
Date: Mon, 21 Sep 2015 21:33:01 +0200 [thread overview]
Message-ID: <1442863981-19112-1-git-send-email-phil@nwl.cc> (raw)
In-Reply-To: <CAK8ArgOM2Vyr4DJO73wzhgFFbGMm9p+XMGcD2JAWeZ8G+_3PSw@mail.gmail.com>
Commit 0532555 ('Support "ip link add help" for rtnl_link API') added a
check for specified help parameter. Though due to the place where it has
been added to, it is not possible anymore to force a given parameter to
be interpreted as interface name by prefixing it with 'dev '. Fix this
by forcing whatever follows 'dev' to be presumed as interface name.
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
ip/iplink.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ip/iplink.c b/ip/iplink.c
index 97f46cd..1c45205 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -647,11 +647,11 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
addattr8(&req->n, sizeof(*req), IFLA_PROTO_DOWN,
proto_down);
} else {
- if (strcmp(*argv, "dev") == 0)
- NEXT_ARG();
-
if (matches(*argv, "help") == 0)
usage();
+
+ if (strcmp(*argv, "dev") == 0)
+ NEXT_ARG();
if (*dev)
duparg2("dev", *argv);
*dev = *argv;
--
2.1.2
next prev parent reply other threads:[~2015-09-21 19:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-17 19:55 iproute2 tunnel name parsing Wilhelm Wijkander
2015-09-17 20:10 ` Vadim Kochan
2015-09-17 23:53 ` Wilhelm Wijkander
2015-09-21 19:33 ` Phil Sutter [this message]
2015-09-21 20:13 ` [iproute2 PATCH] ip-link: do not support 'ip link add dev help' Christoph Schulz
2015-09-21 20:26 ` Phil Sutter
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=1442863981-19112-1-git-send-email-phil@nwl.cc \
--to=phil@nwl.cc \
--cc=lists@0x5e.se \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
--cc=vadim4j@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).