lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 16 Nov 2016 22:45:25 +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 v2 8/9] 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 ab35023..f2bbc0c 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.2

Powered by blists - more mailing lists