From: Asbjørn Sloth Tønnesen Date: Wed, 16 Nov 2016 22:45:25 +0000 (+0000) Subject: l2tp: show tunnel: expose UDP checksum state X-Git-Tag: v4.9.0~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7982f5c9574358c443e6175295dc36b29085003;p=thirdparty%2Fiproute2.git l2tp: show tunnel: expose UDP checksum state Signed-off-by: Asbjørn Sloth Tønnesen --- diff --git a/ip/ipl2tp.c b/ip/ipl2tp.c index ab35023e2..f2bbc0c3e 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)