]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-aoe.c
Use the word 'invalid' for 'malformed' or 'corrupted' packets
[tcpdump] / print-aoe.c
index 0834a2438ff1f8201d4d1c1556677332a7bc8573..02eda7d9b2a759a45ee4e79fdbc2f964e5fcbe96 100644 (file)
@@ -41,7 +41,7 @@
 #include "ether.h"
 
 static const char tstr[] = " [|aoe]";
-static const char cstr[] = " (corrupt)";
+static const char cstr[] = " (invalid)";
 
 #define AOE_V1 1
 #define ATA_SECTOR_SIZE 512
@@ -147,7 +147,7 @@ aoev1_issue_print(netdissect_options *ndo,
        const u_char *ep = cp + len;
 
        if (len < AOEV1_ISSUE_ARG_LEN)
-               goto corrupt;
+               goto invalid;
        /* AFlags */
        ND_TCHECK2(*cp, 1);
        ND_PRINT((ndo, "\n\tAFlags: [%s]", bittok2str(aoev1_aflag_str, "none", *cp)));
@@ -196,7 +196,7 @@ aoev1_issue_print(netdissect_options *ndo,
                ND_PRINT((ndo, "\n\tData: %u bytes", len - AOEV1_ISSUE_ARG_LEN));
        return;
 
-corrupt:
+invalid:
        ND_PRINT((ndo, "%s", cstr));
        ND_TCHECK2(*cp, ep - cp);
        return;
@@ -212,7 +212,7 @@ aoev1_query_print(netdissect_options *ndo,
        uint16_t cslen;
 
        if (len < AOEV1_QUERY_ARG_LEN)
-               goto corrupt;
+               goto invalid;
        /* Buffer Count */
        ND_TCHECK2(*cp, 2);
        ND_PRINT((ndo, "\n\tBuffer Count: %u", EXTRACT_16BITS(cp)));
@@ -235,7 +235,7 @@ aoev1_query_print(netdissect_options *ndo,
        cslen = EXTRACT_16BITS(cp);
        cp += 2;
        if (cslen > AOEV1_MAX_CONFSTR_LEN || AOEV1_QUERY_ARG_LEN + cslen > len)
-               goto corrupt;
+               goto invalid;
        /* Config String */
        ND_TCHECK2(*cp, cslen);
        if (cslen) {
@@ -245,7 +245,7 @@ aoev1_query_print(netdissect_options *ndo,
        }
        return;
 
-corrupt:
+invalid:
        ND_PRINT((ndo, "%s", cstr));
        ND_TCHECK2(*cp, ep - cp);
        return;
@@ -261,7 +261,7 @@ aoev1_mac_print(netdissect_options *ndo,
        uint8_t dircount, i;
 
        if (len < AOEV1_MAC_ARG_LEN)
-               goto corrupt;
+               goto invalid;
        /* Reserved */
        ND_TCHECK2(*cp, 1);
        cp += 1;
@@ -279,7 +279,7 @@ aoev1_mac_print(netdissect_options *ndo,
        cp += 1;
        ND_PRINT((ndo, ", Dir Count: %u", dircount));
        if (AOEV1_MAC_ARG_LEN + dircount * 8 > len)
-               goto corrupt;
+               goto invalid;
        /* directives */
        for (i = 0; i < dircount; i++) {
                /* Reserved */
@@ -296,7 +296,7 @@ aoev1_mac_print(netdissect_options *ndo,
        }
        return;
 
-corrupt:
+invalid:
        ND_PRINT((ndo, "%s", cstr));
        ND_TCHECK2(*cp, ep - cp);
        return;
@@ -312,7 +312,7 @@ aoev1_reserve_print(netdissect_options *ndo,
        uint8_t nmacs, i;
 
        if (len < AOEV1_RESERVE_ARG_LEN || (len - AOEV1_RESERVE_ARG_LEN) % ETHER_ADDR_LEN)
-               goto corrupt;
+               goto invalid;
        /* RCmd */
        ND_TCHECK2(*cp, 1);
        ND_PRINT((ndo, "\n\tRCmd: %s", tok2str(aoev1_rcmd_str, "Unknown (0x%02x)", *cp)));
@@ -323,7 +323,7 @@ aoev1_reserve_print(netdissect_options *ndo,
        cp += 1;
        ND_PRINT((ndo, ", NMacs: %u", nmacs));
        if (AOEV1_RESERVE_ARG_LEN + nmacs * ETHER_ADDR_LEN != len)
-               goto corrupt;
+               goto invalid;
        /* addresses */
        for (i = 0; i < nmacs; i++) {
                ND_PRINT((ndo, "\n\tEthernet Address %u: %s", i, etheraddr_string(ndo, cp)));
@@ -331,7 +331,7 @@ aoev1_reserve_print(netdissect_options *ndo,
        }
        return;
 
-corrupt:
+invalid:
        ND_PRINT((ndo, "%s", cstr));
        ND_TCHECK2(*cp, ep - cp);
        return;
@@ -349,7 +349,7 @@ aoev1_print(netdissect_options *ndo,
        void (*cmd_decoder)(netdissect_options *, const u_char *, const u_int);
 
        if (len < AOEV1_COMMON_HDR_LEN)
-               goto corrupt;
+               goto invalid;
        /* Flags */
        flags = *cp & 0x0F;
        ND_PRINT((ndo, ", Flags: [%s]", bittok2str(aoev1_flag_str, "none", flags)));
@@ -389,7 +389,7 @@ aoev1_print(netdissect_options *ndo,
                cmd_decoder(ndo, cp, len - AOEV1_COMMON_HDR_LEN);
        return;
 
-corrupt:
+invalid:
        ND_PRINT((ndo, "%s", cstr));
        ND_TCHECK2(*cp, ep - cp);
        return;
@@ -407,7 +407,7 @@ aoe_print(netdissect_options *ndo,
        ND_PRINT((ndo, "AoE length %u", len));
 
        if (len < 1)
-               goto corrupt;
+               goto invalid;
        /* Ver/Flags */
        ND_TCHECK2(*cp, 1);
        ver = (*cp & 0xF0) >> 4;
@@ -421,7 +421,7 @@ aoe_print(netdissect_options *ndo,
        }
        return;
 
-corrupt:
+invalid:
        ND_PRINT((ndo, "%s", cstr));
        ND_TCHECK2(*cp, ep - cp);
        return;