From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: stephen@networkplumber.org
Cc: netdev@vger.kernel.org, dsahern@gmail.com,
julien.floret@6wind.com,
Nicolas Dichtel <nicolas.dichtel@6wind.com>,
Matt Ellison <matt@arroyo.io>
Subject: [PATCH iproute2] link_xfrm: don't forcce to set phydev
Date: Mon, 16 Sep 2019 17:36:27 +0200 [thread overview]
Message-ID: <20190916153627.19458-1-nicolas.dichtel@6wind.com> (raw)
Since linux commit 22d6552f827e ("xfrm interface: fix management of
phydev"), phydev is not mandatory anymore.
Note that it also could be useful before the above commit to not force the
user to put a phydev (the kernel was checking it anyway).
For example, it was useful to not set it in case of x-netns, because the
phydev is not available in the current netns:
Before the patch:
$ ip netns add foo
$ ip link add xfrm1 type xfrm dev eth1 if_id 1
$ ip link set xfrm1 netns foo
$ ip -n foo link set xfrm1 type xfrm dev eth1 if_id 2
Cannot find device "eth1"
$ ip -n foo link set xfrm1 type xfrm if_id 2
must specify physical device
CC: Matt Ellison <matt@arroyo.io>
Fixes: 286446c1e8c7 ("ip: support for xfrm interfaces")
Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=22d6552f827e
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
ip/link_xfrm.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/ip/link_xfrm.c b/ip/link_xfrm.c
index 7a3285b42045..a28f308d5610 100644
--- a/ip/link_xfrm.c
+++ b/ip/link_xfrm.c
@@ -17,7 +17,7 @@ static void xfrm_print_help(struct link_util *lu, int argc, char **argv,
FILE *f)
{
fprintf(f,
- "Usage: ... %-4s dev PHYS_DEV [ if_id IF-ID ]\n"
+ "Usage: ... %-4s dev [ PHYS_DEV ] [ if_id IF-ID ]\n"
"\n"
"Where: IF-ID := { 0x0..0xffffffff }\n",
lu->id);
@@ -46,12 +46,8 @@ static int xfrm_parse_opt(struct link_util *lu, int argc, char **argv,
argc--; argv++;
}
- if (link) {
+ if (link)
addattr32(n, 1024, IFLA_XFRM_LINK, link);
- } else {
- fprintf(stderr, "must specify physical device\n");
- return -1;
- }
return 0;
}
--
2.21.0
next reply other threads:[~2019-09-16 15:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-16 15:36 Nicolas Dichtel [this message]
2019-09-16 17:29 ` [PATCH iproute2] link_xfrm: don't forcce to set phydev Matt Ellison
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=20190916153627.19458-1-nicolas.dichtel@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=dsahern@gmail.com \
--cc=julien.floret@6wind.com \
--cc=matt@arroyo.io \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox