do not exit silently when link is not found
When we create a tunnel on top of a link and the link specified
in cmdline doesn't exist, an error message should be shown.
Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
diff --git a/ip/link_vti.c b/ip/link_vti.c
index 77a7482..6274c83 100644
--- a/ip/link_vti.c
+++ b/ip/link_vti.c
@@ -171,8 +171,11 @@
} else if (!matches(*argv, "dev")) {
NEXT_ARG();
link = if_nametoindex(*argv);
- if (link == 0)
+ if (link == 0) {
+ fprintf(stderr, "Cannot find device \"%s\"\n",
+ *argv);
exit(-1);
+ }
} else
usage();
argc--; argv++;