]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ip-link: do not support 'ip link add dev help'
authorPhil Sutter <phil@nwl.cc>
Mon, 21 Sep 2015 19:33:01 +0000 (21:33 +0200)
committerStephen Hemminger <shemming@brocade.com>
Wed, 23 Sep 2015 23:00:48 +0000 (16:00 -0700)
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

index 97f46cdee56714808628b2489732d056a7fa035d..1c452055b5f0b71b76eb63dc5f6f0c799c38ed41 100644 (file)
@@ -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;