From: Guy Harris Date: Sun, 9 Oct 2016 01:43:22 +0000 (-0700) Subject: Fix some names for MPLS PW types, and use that table for LDP. X-Git-Tag: tcpdump-4.9.0-bp~150 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/43587bee2e4f23249bfbe51e9025b94973d77ce3 Fix some names for MPLS PW types, and use that table for LDP. --- diff --git a/l2vpn.c b/l2vpn.c index 156139ba..47d6a4c8 100644 --- a/l2vpn.c +++ b/l2vpn.c @@ -60,8 +60,8 @@ const struct tok l2vpn_encaps_values[] = { */ const struct tok mpls_pw_types_values[] = { { 0x0000, "Reserved"}, - { 0x0001, "Frame Relay"}, - { 0x0002, "ATM AAL5 VCC transport"}, + { 0x0001, "Frame Relay DLCI (Martini Mode)"}, + { 0x0002, "ATM AAL5 SDU VCC transport"}, { 0x0003, "ATM transparent cell transport"}, { 0x0004, "Ethernet VLAN"}, { 0x0005, "Ethernet"}, diff --git a/print-ldp.c b/print-ldp.c index 68149bba..40c9d8c2 100644 --- a/print-ldp.c +++ b/print-ldp.c @@ -379,17 +379,21 @@ ldp_tlv_print(netdissect_options *ndo, case LDP_FEC_HOSTADDRESS: break; case LDP_FEC_MARTINI_VC: + /* + * We assume the type was supposed to be one of the MPLS + * Pseudowire Types. + */ + TLV_TCHECK(7); + vc_info_len = *(tptr+2); + /* * According to RFC 4908, the VC info Length field can be zero, * in which case not only are there no interface parameters, * there's no VC ID. */ - TLV_TCHECK(7); - vc_info_len = *(tptr+2); - if (vc_info_len == 0) { ND_PRINT((ndo, ": %s, %scontrol word, group-ID %u, VC-info-length: %u", - tok2str(l2vpn_encaps_values, "Unknown", EXTRACT_16BITS(tptr)&0x7fff), + tok2str(mpls_pw_types_values, "Unknown", EXTRACT_16BITS(tptr)&0x7fff), EXTRACT_16BITS(tptr)&0x8000 ? "" : "no ", EXTRACT_32BITS(tptr+3), vc_info_len)); @@ -399,7 +403,7 @@ ldp_tlv_print(netdissect_options *ndo, /* Make sure we have the VC ID as well */ TLV_TCHECK(11); ND_PRINT((ndo, ": %s, %scontrol word, group-ID %u, VC-ID %u, VC-info-length: %u", - tok2str(l2vpn_encaps_values, "Unknown", EXTRACT_16BITS(tptr)&0x7fff), + tok2str(mpls_pw_types_values, "Unknown", EXTRACT_16BITS(tptr)&0x7fff), EXTRACT_16BITS(tptr)&0x8000 ? "" : "no ", EXTRACT_32BITS(tptr+3), EXTRACT_32BITS(tptr+7),