From: Phil Sutter <phil@nwl.cc>
To: Stephen Hemminger <shemming@brocade.com>
Cc: netdev@vger.kernel.org
Subject: [iproute PATCH 03/12] ip{,6}tunnel: unify behaviour if physical device is not found
Date: Fri, 13 Nov 2015 18:08:56 +0100 [thread overview]
Message-ID: <1447434545-32182-4-git-send-email-phil@nwl.cc> (raw)
In-Reply-To: <1447434545-32182-1-git-send-email-phil@nwl.cc>
Make ip6tunnel print an error message as well. While there, get rid of
unnecessary line breaking.
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
ip/ip6tunnel.c | 4 +++-
ip/iptunnel.c | 3 +--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/ip/ip6tunnel.c b/ip/ip6tunnel.c
index 8b842b6..410276f 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 9c9dc54..803bb83 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;
}
}
--
2.1.2
next prev parent reply other threads:[~2015-11-13 17:09 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-13 17:08 [iproute PATCH 00/12] smaller iptunnel and ip6tunnel review Phil Sutter
2015-11-13 17:08 ` [iproute PATCH 01/12] ip{,6}tunnel: get rid of extraneous whitespace when printing Phil Sutter
2015-11-13 17:08 ` [iproute PATCH 02/12] ip/tunnel: introduce tnl_parse_key() Phil Sutter
2015-11-13 17:08 ` Phil Sutter [this message]
2015-11-13 17:08 ` [iproute PATCH 04/12] iptunnel: use ll_name_to_index() for physical interface lookup Phil Sutter
2015-11-13 17:08 ` [iproute PATCH 05/12] ip{,6}tunnel: align do_tunnels_list() a bit Phil Sutter
2015-11-13 17:30 ` David Laight
2015-11-13 17:53 ` Phil Sutter
2015-11-13 17:08 ` [iproute PATCH 06/12] ip6tunnel: print local/remote addresses like iptunnel does Phil Sutter
2015-11-13 17:09 ` [iproute PATCH 07/12] ip6tunnel: fix coding style: no newline between brace and else Phil Sutter
2015-11-13 17:09 ` [iproute PATCH 08/12] iptunnel: share common code when setting tunnel mode Phil Sutter
2015-11-13 17:09 ` [iproute PATCH 09/12] iptunnel: simplify parsing TTL, allow 'hlim' as identifier Phil Sutter
2015-11-13 17:09 ` [iproute PATCH 10/12] iptunnel: share common code when determining the default interface name Phil Sutter
2015-11-13 17:09 ` [iproute PATCH 11/12] iptunnel: sanitize copying tunnel name Phil Sutter
2015-11-13 17:09 ` [iproute PATCH 12/12] ip{,6}tunnel: put spaces around non-unary operators Phil Sutter
2015-11-23 23:28 ` [iproute PATCH 00/12] smaller iptunnel and ip6tunnel review Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1447434545-32182-4-git-send-email-phil@nwl.cc \
--to=phil@nwl.cc \
--cc=netdev@vger.kernel.org \
--cc=shemming@brocade.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).