X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/99c91c3aec40b691641374f58e798bd8d6b657bd..6c8ef0eb86a39c277d1a43802dd8ea01b51cfb2a:/print-aoe.c diff --git a/print-aoe.c b/print-aoe.c index abad1548..fcb75264 100644 --- a/print-aoe.c +++ b/print-aoe.c @@ -1,8 +1,4 @@ /* - * This module implements decoding of the ATA over Ethernet (AoE) protocol - * according to the following specification: - * http://support.coraid.com/documents/AoEr11.txt - * * Copyright (c) 2014 The TCPDUMP project * All rights reserved. * @@ -29,6 +25,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ +/* \summary: ATA over Ethernet (AoE) protocol printer */ + +/* specification: http://brantleycoilecompany.com/AoEr11.pdf */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -41,7 +41,6 @@ #include "ether.h" static const char tstr[] = " [|aoe]"; -static const char istr[] = " (invalid)"; #define AOE_V1 1 #define ATA_SECTOR_SIZE 512 @@ -326,6 +325,7 @@ aoev1_reserve_print(netdissect_options *ndo, goto invalid; /* addresses */ for (i = 0; i < nmacs; i++) { + ND_TCHECK2(*cp, ETHER_ADDR_LEN); ND_PRINT((ndo, "\n\tEthernet Address %u: %s", i, etheraddr_string(ndo, cp))); cp += ETHER_ADDR_LEN; } @@ -351,6 +351,7 @@ aoev1_print(netdissect_options *ndo, if (len < AOEV1_COMMON_HDR_LEN) goto invalid; /* Flags */ + ND_TCHECK2(*cp, 1); flags = *cp & 0x0F; ND_PRINT((ndo, ", Flags: [%s]", bittok2str(aoev1_flag_str, "none", flags))); cp += 1;