]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-stp.c
gre: add support for MikroTik Ethernet-over-IP hack.
[tcpdump] / print-stp.c
index b8973ace81c9bb5285815759e9f51c375fe1bef3..bfaf37826500b7fe47d4cae30c95fe13b9f4cec3 100644 (file)
@@ -144,7 +144,7 @@ stp_print_config_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu,
  *
  * 2 -  bytes Protocol Id
  * 1 -  byte  Protocol Ver.
- * 1 -  byte  BPDU tye
+ * 1 -  byte  BPDU type
  * 1 -  byte  Flags
  * 8 -  bytes CIST Root Identifier
  * 4 -  bytes CIST External Path Cost
@@ -203,7 +203,7 @@ stp_print_config_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu,
 #define MST_BPDU_MSTI_LENGTH               16
 #define MST_BPDU_CONFIG_INFO_LENGTH        64
 
-/* Offsets of fields from the begginning for the packet */
+/* Offsets of fields from the beginning for the packet */
 #define MST_BPDU_VER3_LEN_OFFSET           36
 #define MST_BPDU_CONFIG_NAME_OFFSET        39
 #define MST_BPDU_CONFIG_DIGEST_OFFSET      73
@@ -276,7 +276,7 @@ stp_print_mstp_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu,
 
     ND_PRINT("\n\tv3len %u, ", GET_BE_U_2(ptr + MST_BPDU_VER3_LEN_OFFSET));
     ND_PRINT("MCID Name ");
-    (void)nd_printzp(ndo, ptr + MST_BPDU_CONFIG_NAME_OFFSET, 32, NULL);
+    nd_printjnp(ndo, ptr + MST_BPDU_CONFIG_NAME_OFFSET, 32);
     ND_PRINT(", rev %u,"
             "\n\t\tdigest %08x%08x%08x%08x, ",
                  GET_BE_U_2(ptr + MST_BPDU_CONFIG_NAME_OFFSET + 32),
@@ -340,7 +340,7 @@ stp_print_spb_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu,
 
     ND_PRINT("\n\tv4len %u, ", GET_BE_U_2(ptr + offset));
     ND_PRINT("AUXMCID Name ");
-    (void)nd_printzp(ndo, ptr + offset + SPB_BPDU_CONFIG_NAME_OFFSET, 32, NULL);
+    nd_printjnp(ndo, ptr + offset + SPB_BPDU_CONFIG_NAME_OFFSET, 32);
     ND_PRINT(", Rev %u,\n\t\tdigest %08x%08x%08x%08x",
             GET_BE_U_2(ptr + offset + SPB_BPDU_CONFIG_REV_OFFSET),
             GET_BE_U_4(ptr + offset + SPB_BPDU_CONFIG_DIGEST_OFFSET),
@@ -443,8 +443,7 @@ stp_print(netdissect_options *ndo, const u_char *p, u_int length)
             }
             stp_print_mstp_bpdu(ndo, stp_bpdu, length);
 
-            if (protocol_version == STP_PROTO_SPB)
-            {
+            if (protocol_version == STP_PROTO_SPB) {
               /* Validate v4 length */
               spb_len = GET_BE_U_2(p + MST_BPDU_VER3_LEN_OFFSET + mstp_len);
               spb_len += 2;