From: Phil Sutter Date: Mon, 21 Sep 2015 19:33:01 +0000 (+0200) Subject: ip-link: do not support 'ip link add dev help' X-Git-Tag: v4.3.0~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=940a96e6ca9a14cd52c97a719a1700b417adb2fb;p=thirdparty%2Fiproute2.git ip-link: do not support 'ip link add dev help' 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 --- diff --git a/ip/iplink.c b/ip/iplink.c index 97f46cdee..1c452055b 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;