X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/63610e417b2d1bd99cb41e0bb5e129015b0aeb4e..c50f3934dacc4bd3fe16a900d4c63c05acb50ce3:/print-aoe.c diff --git a/print-aoe.c b/print-aoe.c index c4f3758f..0759ef38 100644 --- a/print-aoe.c +++ b/print-aoe.c @@ -31,9 +31,7 @@ * https://web.archive.org/web/20161025044402/http://brantleycoilecompany.com/AoEr11.pdf */ -#ifdef HAVE_CONFIG_H #include -#endif #include "netdissect-stdinc.h" @@ -235,7 +233,7 @@ aoev1_query_print(netdissect_options *ndo, /* Config String */ if (cslen) { ND_PRINT("\n\tConfig String (length %u): ", cslen); - (void)nd_printn(ndo, cp, cslen, NULL); + nd_printjn(ndo, cp, cslen); } return; @@ -270,7 +268,7 @@ aoev1_mac_print(netdissect_options *ndo, cp += 1; len -= 1; ND_PRINT(", Dir Count: %u", dircount); - if (dircount * 8 > len) + if (dircount * 8U > len) goto invalid; /* directives */ for (i = 0; i < dircount; i++) { @@ -283,9 +281,9 @@ aoev1_mac_print(netdissect_options *ndo, cp += 1; len -= 1; /* Ethernet Address */ - ND_PRINT(", Ethernet Address: %s", GET_ETHERADDR_STRING(cp)); - cp += MAC_ADDR_LEN; - len -= MAC_ADDR_LEN; + ND_PRINT(", Ethernet Address: %s", GET_MAC48_STRING(cp)); + cp += MAC48_LEN; + len -= MAC48_LEN; } return; @@ -300,7 +298,7 @@ aoev1_reserve_print(netdissect_options *ndo, { uint8_t nmacs, i; - if (len < AOEV1_RESERVE_ARG_LEN || (len - AOEV1_RESERVE_ARG_LEN) % MAC_ADDR_LEN) + if (len < AOEV1_RESERVE_ARG_LEN || (len - AOEV1_RESERVE_ARG_LEN) % MAC48_LEN) goto invalid; /* RCmd */ ND_PRINT("\n\tRCmd: %s", @@ -312,13 +310,13 @@ aoev1_reserve_print(netdissect_options *ndo, cp += 1; len -= 1; ND_PRINT(", NMacs: %u", nmacs); - if (nmacs * MAC_ADDR_LEN != len) + if (nmacs * MAC48_LEN != len) goto invalid; /* addresses */ for (i = 0; i < nmacs; i++) { - ND_PRINT("\n\tEthernet Address %u: %s", i, GET_ETHERADDR_STRING(cp)); - cp += MAC_ADDR_LEN; - len -= MAC_ADDR_LEN; + ND_PRINT("\n\tEthernet Address %u: %s", i, GET_MAC48_STRING(cp)); + cp += MAC48_LEN; + len -= MAC48_LEN; } return;