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/iptunnel.c b/ip/iptunnel.c
index 9ae8847..f96ce45 100644
--- a/ip/iptunnel.c
+++ b/ip/iptunnel.c
@@ -250,8 +250,11 @@
if (medium[0]) {
p->link = if_nametoindex(medium);
- if (p->link == 0)
+ if (p->link == 0) {
+ fprintf(stderr, "Cannot find device \"%s\"\n",
+ medium);
return -1;
+ }
}
if (p->i_key == 0 && IN_MULTICAST(ntohl(p->iph.daddr))) {