* [PATCH iproute2] Show 'external' link mode in output
@ 2017-12-12 20:23 Phil Dibowitz
2017-12-13 10:05 ` Sergei Shtylyov
2017-12-13 20:15 ` Stephen Hemminger
0 siblings, 2 replies; 4+ messages in thread
From: Phil Dibowitz @ 2017-12-12 20:23 UTC (permalink / raw)
To: netdev; +Cc: phild
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH iproute2] Show 'external' link mode in output
2017-12-12 20:23 [PATCH iproute2] Show 'external' link mode in output Phil Dibowitz
@ 2017-12-13 10:05 ` Sergei Shtylyov
2017-12-13 17:15 ` Phil Dibowitz
2017-12-13 20:15 ` Stephen Hemminger
1 sibling, 1 reply; 4+ messages in thread
From: Sergei Shtylyov @ 2017-12-13 10:05 UTC (permalink / raw)
To: Phil Dibowitz, netdev; +Cc: phild
Hello!
On 12/12/2017 11:23 PM, Phil Dibowitz wrote:
> 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);
> +
The original code is indented with tabs, you're using spaces. Not good. :-)
> 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]);
>
Here as well...
MBR, Sergei
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH iproute2] Show 'external' link mode in output
2017-12-13 10:05 ` Sergei Shtylyov
@ 2017-12-13 17:15 ` Phil Dibowitz
0 siblings, 0 replies; 4+ messages in thread
From: Phil Dibowitz @ 2017-12-13 17:15 UTC (permalink / raw)
To: Sergei Shtylyov, netdev; +Cc: phild
[-- Attachment #1.1: Type: text/plain, Size: 556 bytes --]
On 12/13/2017 02:05 AM, Sergei Shtylyov wrote:
> Hello!
Hi!
> The original code is indented with tabs, you're using spaces. Not
> good. :-)
I sent a v2 of the patch later yesterday that fixed this.
Thanks!
--
Phil Dibowitz phil@ipom.com
Open Source software and tech docs Insanity Palace of Metallica
http://www.phildev.net/ http://www.ipom.com/
"Be who you are and say what you feel, because those who mind don't
matter and those who matter don't mind."
- Dr. Seuss
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 854 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH iproute2] Show 'external' link mode in output
2017-12-12 20:23 [PATCH iproute2] Show 'external' link mode in output Phil Dibowitz
2017-12-13 10:05 ` Sergei Shtylyov
@ 2017-12-13 20:15 ` Stephen Hemminger
1 sibling, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2017-12-13 20:15 UTC (permalink / raw)
To: Phil Dibowitz; +Cc: netdev, phild
On Tue, 12 Dec 2017 12:23:19 -0800
Phil Dibowitz <phil@ipom.com> wrote:
> 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>
Applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-12-13 20:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-12 20:23 [PATCH iproute2] Show 'external' link mode in output Phil Dibowitz
2017-12-13 10:05 ` Sergei Shtylyov
2017-12-13 17:15 ` Phil Dibowitz
2017-12-13 20:15 ` Stephen Hemminger
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.