]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-vtp.c
CI: Add warning exemptions for Sun C (suncc-5.14) on Solaris 10
[tcpdump] / print-vtp.c
index e0c7ded272490b7117540c4c01469082b64bd2f6..82dfe2b3234463b2093871af2b7325465636efa6 100644 (file)
@@ -21,9 +21,7 @@
 
 /* \summary: Cisco VLAN Trunking Protocol (VTP) printer */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
 
 #include "netdissect-stdinc.h"
 
@@ -148,10 +146,10 @@ vtp_print(netdissect_options *ndo,
     ND_PRINT("\n\tDomain name: ");
     mgmtd_len = GET_U_1(tptr + 3);
     if (mgmtd_len < 1 ||  mgmtd_len > VTP_DOMAIN_NAME_LEN) {
-       ND_PRINT(" [invalid MgmtD Len %u]", mgmtd_len);
+       ND_PRINT(" [MgmtD Len %u]", mgmtd_len);
        goto invalid;
     }
-    nd_printzp(ndo, tptr + 4, mgmtd_len, NULL);
+    nd_printjnp(ndo, tptr + 4, mgmtd_len);
     ND_PRINT(", %s: %u",
           tok2str(vtp_header_values, "Unknown", type),
           GET_U_1(tptr + 2));
@@ -261,7 +259,7 @@ vtp_print(netdissect_options *ndo,
            name_len = GET_U_1(vtp_vlan->name_len);
            if (len < 4*((name_len + 3)/4))
                goto invalid;
-           nd_printzp(ndo, tptr, name_len, NULL);
+           nd_printjnp(ndo, tptr, name_len);
 
            /*
             * Vlan names are aligned to 32-bit boundaries.
@@ -271,7 +269,7 @@ vtp_print(netdissect_options *ndo,
 
             /* TLV information follows */
 
-            while (len > 0) {
+            while (len != 0) {
 
                 /*
                  * Cisco specs say 2 bytes for type + 2 bytes for length;
@@ -300,7 +298,7 @@ vtp_print(netdissect_options *ndo,
                  * in units of 16-bit words.
                  */
                 if (tlv_len != 1) {
-                    ND_PRINT(" (invalid TLV length %u != 1)", tlv_len);
+                    ND_PRINT(" [TLV length %u != 1]", tlv_len);
                     goto invalid;
                 } else {
                     tlv_value = GET_BE_U_2(tptr + 2);