From mboxrd@z Thu Jan 1 00:00:00 1970 From: Phil Dibowitz Subject: [PATCH iproute2] Show 'external' link mode in output Date: Tue, 12 Dec 2017 12:23:19 -0800 Message-ID: <20171212202319.GA7066@ipom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: phild@fb.com To: netdev@vger.kernel.org Return-path: Received: from mail.ipom.com ([96.126.97.66]:50208 "EHLO mail.ipom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750749AbdLLU2y (ORCPT ); Tue, 12 Dec 2017 15:28:54 -0500 Received: from knight.no-ip.info (c-76-103-48-74.hsd1.ca.comcast.net [76.103.48.74]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.ipom.com (Postfix) with ESMTPS id BE305464004 for ; Tue, 12 Dec 2017 20:23:22 +0000 (UTC) Content-Disposition: inline Sender: netdev-owner@vger.kernel.org List-ID: 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: 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 --- 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