[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20161104231111.14677-7-asbjorn@asbjorn.st>
Date: Fri, 4 Nov 2016 23:11:11 +0000
From: Asbjørn Sloth Tønnesen
<asbjorn@...jorn.st>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: James Chapman <jchapman@...alix.com>, netdev@...r.kernel.org
Subject: [PATCH iproute2 7/7] l2tp: show tunnel: expose UDP checksum state
Signed-off-by: Asbjørn Sloth Tønnesen <asbjorn@...jorn.st>
---
ip/ipl2tp.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/ip/ipl2tp.c b/ip/ipl2tp.c
index 8f3268d..27dc184 100644
--- a/ip/ipl2tp.c
+++ b/ip/ipl2tp.c
@@ -218,9 +218,24 @@ static void print_tunnel(const struct l2tp_data *data)
printf(" Peer tunnel %u\n",
p->peer_tunnel_id);
- if (p->encap == L2TP_ENCAPTYPE_UDP)
+ if (p->encap == L2TP_ENCAPTYPE_UDP) {
printf(" UDP source / dest ports: %hu/%hu\n",
p->local_udp_port, p->peer_udp_port);
+
+ switch (p->local_ip.family) {
+ case AF_INET:
+ printf(" UDP checksum: %s\n",
+ p->udp_csum ? "enabled" : "disabled");
+ break;
+ case AF_INET6:
+ printf(" UDP checksum: %s%s%s%s\n",
+ p->udp6_csum_tx && p->udp6_csum_rx ? "enabled" : "",
+ p->udp6_csum_tx && !p->udp6_csum_rx ? "tx" : "",
+ !p->udp6_csum_tx && p->udp6_csum_rx ? "rx" : "",
+ !p->udp6_csum_tx && !p->udp6_csum_rx ? "disabled" : "");
+ break;
+ }
+ }
}
static void print_session(struct l2tp_data *data)
--
2.10.1
Powered by blists - more mailing lists