All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phil Dibowitz <phil@ipom.com>
To: netdev@vger.kernel.org
Cc: phild@fb.com
Subject: [PATCH iproute2] Show 'external' link mode in output
Date: Tue, 12 Dec 2017 12:23:19 -0800	[thread overview]
Message-ID: <20171212202319.GA7066@ipom.com> (raw)

Recently `external` support was added to the tunnel drivers, but there is no way
to introspect this from userspace. This adds support for that.

Now `ip -details link` shows it:

```
7: tunl60@NONE: <NOARP> mtu 1452 qdisc noop state DOWN mode DEFAULT group
default qlen 1
    link/tunnel6 :: brd :: promiscuity 0
    ip6tnl external any remote :: local :: encaplimit 0 hoplimit 0 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
```

Signed-off-by: Phil Dibowitz <phil@ipom.com>
---
 ip/link_ip6tnl.c | 3 +++
 ip/link_iptnl.c  | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/ip/link_ip6tnl.c b/ip/link_ip6tnl.c
index 43287ab..5d0efc8 100644
--- a/ip/link_ip6tnl.c
+++ b/ip/link_ip6tnl.c
@@ -345,6 +345,9 @@ static void ip6tunnel_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb
 	if (!tb)
 		return;
 
+        if (tb[IFLA_IPTUN_COLLECT_METADATA])
+                print_bool(PRINT_ANY, "external", "external ", true);
+
 	if (tb[IFLA_IPTUN_FLAGS])
 		flags = rta_getattr_u32(tb[IFLA_IPTUN_FLAGS]);
 
diff --git a/ip/link_iptnl.c b/ip/link_iptnl.c
index 4940b8b..e345b5c 100644
--- a/ip/link_iptnl.c
+++ b/ip/link_iptnl.c
@@ -393,6 +393,9 @@ static void iptunnel_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[
 	if (!tb)
 		return;
 
+        if (tb[IFLA_IPTUN_COLLECT_METADATA])
+                print_bool(PRINT_ANY, "external", "external ", true);
+
 	if (tb[IFLA_IPTUN_REMOTE]) {
 		unsigned int addr = rta_getattr_u32(tb[IFLA_IPTUN_REMOTE]);
 
-- 
2.9.5

             reply	other threads:[~2017-12-12 20:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-12 20:23 Phil Dibowitz [this message]
2017-12-13 10:05 ` [PATCH iproute2] Show 'external' link mode in output Sergei Shtylyov
2017-12-13 17:15   ` Phil Dibowitz
2017-12-13 20:15 ` 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=20171212202319.GA7066@ipom.com \
    --to=phil@ipom.com \
    --cc=netdev@vger.kernel.org \
    --cc=phild@fb.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 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.