]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Fix some names for MPLS PW types, and use that table for LDP.
authorGuy Harris <[email protected]>
Sun, 9 Oct 2016 01:43:22 +0000 (18:43 -0700)
committerGuy Harris <[email protected]>
Sun, 9 Oct 2016 01:43:22 +0000 (18:43 -0700)
l2vpn.c
print-ldp.c

diff --git a/l2vpn.c b/l2vpn.c
index 156139baa73d7b81db316068d2aef2cf5c575301..47d6a4c84a0d05e19b59a5a236e7cc453b3a2b5a 100644 (file)
--- 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"},
index 68149bba2447f988dc3ef94f9da2c30465649e2f..40c9d8c2a22cf054056e60f5c7c4871e907e77f4 100644 (file)
@@ -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),