From: Phil Sutter Date: Fri, 13 Nov 2015 17:08:56 +0000 (+0100) Subject: ip{, 6}tunnel: unify behaviour if physical device is not found X-Git-Tag: v4.4.0~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ddb1e8c900668a22aaaf8d5f3b1586c0e88efcd;p=thirdparty%2Fiproute2.git ip{, 6}tunnel: unify behaviour if physical device is not found Make ip6tunnel print an error message as well. While there, get rid of unnecessary line breaking. Signed-off-by: Phil Sutter --- diff --git a/ip/ip6tunnel.c b/ip/ip6tunnel.c index 8b842b686..410276f16 100644 --- a/ip/ip6tunnel.c +++ b/ip/ip6tunnel.c @@ -278,8 +278,10 @@ static int parse_args(int argc, char **argv, int cmd, struct ip6_tnl_parm2 *p) } if (medium[0]) { p->link = ll_name_to_index(medium); - if (p->link == 0) + if (p->link == 0) { + fprintf(stderr, "Cannot find device \"%s\"\n", medium); return -1; + } } return 0; } diff --git a/ip/iptunnel.c b/ip/iptunnel.c index 9c9dc548a..803bb8328 100644 --- a/ip/iptunnel.c +++ b/ip/iptunnel.c @@ -228,8 +228,7 @@ static int parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p) if (medium[0]) { p->link = if_nametoindex(medium); if (p->link == 0) { - fprintf(stderr, "Cannot find device \"%s\"\n", - medium); + fprintf(stderr, "Cannot find device \"%s\"\n", medium); return -1; } }