From: Serhey Popovych Date: Fri, 19 Jan 2018 16:44:02 +0000 (+0200) Subject: vti/vti6: Minor improvements X-Git-Tag: v4.15.0~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9dc04a4fd2f950908db48bf1f39cd9c581c46443;p=thirdparty%2Fiproute2.git vti/vti6: Minor improvements 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 Signed-off-by: Stephen Hemminger --- diff --git a/ip/link_vti.c b/ip/link_vti.c index 1439e53c6..6a088c6f3 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 2a86d5922..a11f389cd 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);