Commit 8aacb9bb authored by Christoph Schulz's avatar Christoph Schulz Committed by Stephen Hemminger

ip: allow using a device "help" (or a prefix thereof)

Device names that match "help" or a prefix thereof should be allowed anywhere
a device name can be used. Note that a suitable keyword ("dev" or "name", the
latter for "ip tunnel") has to be used in these cases to resolve ambiguities.
Signed-off-by: default avatarChristoph Schulz <develop@kristov.de>
Reported-by: default avatarLeonhard Preis <leonhard@pre.is>
Reported-by: default avatarWilhelm Wijkander <lists@0x5e.se>
parent 09a50f42
......@@ -287,7 +287,7 @@ static int parse_args(int argc, char **argv, int cmd, struct ip6_tnl_parm2 *p)
if (strcmp(*argv, "name") == 0) {
NEXT_ARG();
}
if (matches(*argv, "help") == 0)
else if (matches(*argv, "help") == 0)
usage();
if (p->name[0])
duparg2("name", *argv);
......
......@@ -1580,7 +1580,7 @@ static int ipaddr_list_flush_or_save(int argc, char **argv, int action)
if (strcmp(*argv, "dev") == 0) {
NEXT_ARG();
}
if (matches(*argv, "help") == 0)
else if (matches(*argv, "help") == 0)
usage();
if (filter_dev)
duparg2("dev", *argv);
......
......@@ -1148,8 +1148,7 @@ static int do_set(int argc, char **argv)
} else {
if (strcmp(*argv, "dev") == 0)
NEXT_ARG();
if (matches(*argv, "help") == 0)
else if (matches(*argv, "help") == 0)
usage();
if (dev)
......
......@@ -257,7 +257,7 @@ static int multiaddr_list(int argc, char **argv)
if (strcmp(*argv, "dev") == 0) {
NEXT_ARG();
}
if (matches(*argv, "help") == 0)
else if (matches(*argv, "help") == 0)
usage();
if (filter.dev)
duparg2("dev", *argv);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment