From: Serhey Popovych <serhe.popovych@gmail.com>
To: netdev@vger.kernel.org
Subject: [PATCH iproute2 3/4] vti/vti6: Minor improvements
Date: Fri, 19 Jan 2018 18:44:02 +0200 [thread overview]
Message-ID: <1516380243-32568-4-git-send-email-serhe.popovych@gmail.com> (raw)
In-Reply-To: <1516380243-32568-1-git-send-email-serhe.popovych@gmail.com>
In prepare of link_vti.c and link_vti6.c merge:
1) Make @fwmark of __u32 type instead of unsigned int
in vti to match with rest tunneling code.
2) Report when unable to translate @link network device
name to index instead of silently exiting in vti6.
3) Remove newline separating local/remote attributes
from the ikey/okey in vti6 to match vti module.
Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
---
ip/link_vti.c | 2 +-
ip/link_vti6.c | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/ip/link_vti.c b/ip/link_vti.c
index 1439e53..6a088c6 100644
--- a/ip/link_vti.c
+++ b/ip/link_vti.c
@@ -69,7 +69,7 @@ static int vti_parse_opt(struct link_util *lu, int argc, char **argv,
unsigned int saddr = 0;
unsigned int daddr = 0;
unsigned int link = 0;
- unsigned int fwmark = 0;
+ __u32 fwmark = 0;
int len;
if (!(n->nlmsg_flags & NLM_F_CREATE)) {
diff --git a/ip/link_vti6.c b/ip/link_vti6.c
index 2a86d59..a11f389 100644
--- a/ip/link_vti6.c
+++ b/ip/link_vti6.c
@@ -144,8 +144,11 @@ get_failed:
} 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 if (strcmp(*argv, "fwmark") == 0) {
NEXT_ARG();
if (get_u32(&fwmark, *argv, 0))
@@ -157,7 +160,6 @@ get_failed:
addattr32(n, 1024, IFLA_VTI_IKEY, ikey);
addattr32(n, 1024, IFLA_VTI_OKEY, okey);
-
addattr_l(n, 1024, IFLA_VTI_LOCAL, &saddr, sizeof(saddr));
addattr_l(n, 1024, IFLA_VTI_REMOTE, &daddr, sizeof(daddr));
addattr32(n, 1024, IFLA_VTI_FWMARK, fwmark);
--
1.7.10.4
next prev parent reply other threads:[~2018-01-19 16:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-19 16:43 [PATCH iproute2 0/4] ip/tunnel: Minor cleanups and improvements Serhey Popovych
2018-01-19 16:44 ` [PATCH iproute2 1/4] tunnel: Add space between encap-dport and encap-sport in non-JSON output Serhey Popovych
2018-01-19 16:44 ` [PATCH iproute2 2/4] iptnl/ip6tnl: Unify ttl/hoplimit parsing routines Serhey Popovych
2018-01-19 16:44 ` Serhey Popovych [this message]
2018-01-19 16:44 ` [PATCH iproute2 4/4] iplink: Use ll_name_to_index() instead of if_nametoindex() Serhey Popovych
2018-01-23 22:52 ` [PATCH iproute2 0/4] ip/tunnel: Minor cleanups and improvements 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=1516380243-32568-4-git-send-email-serhe.popovych@gmail.com \
--to=serhe.popovych@gmail.com \
--cc=netdev@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.