X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/39c8c55aa9ff84244cf558b9a957b78933babf0a..974a69a10a743e47bc0be54a21585ae30eadf88a:/print-openflow.c?ds=sidebyside diff --git a/print-openflow.c b/print-openflow.c index 16d1e18b..3ef91432 100644 --- a/print-openflow.c +++ b/print-openflow.c @@ -86,11 +86,11 @@ of_header_body_print(netdissect_options *ndo, const u_char *cp, const u_char *ep goto invalid; /* version */ ND_TCHECK_1(cp); - version = *cp; + version = EXTRACT_U_1(cp); cp += 1; /* type */ ND_TCHECK_1(cp); - type = *cp; + type = EXTRACT_U_1(cp); cp += 1; /* length */ ND_TCHECK_2(cp); @@ -116,13 +116,13 @@ of_header_body_print(netdissect_options *ndo, const u_char *cp, const u_char *ep return of10_header_body_print(ndo, cp, ep, type, length, xid); default: of_header_print(ndo, version, type, length, xid); - ND_TCHECK2(*cp, length - OF_HEADER_LEN); + ND_TCHECK_LEN(cp, length - OF_HEADER_LEN); return cp + length - OF_HEADER_LEN; /* done with current message */ } invalid: /* fail current packet */ ND_PRINT((ndo, "%s", istr)); - ND_TCHECK2(*cp, ep - cp); + ND_TCHECK_LEN(cp, ep - cp); return ep; trunc: ND_PRINT((ndo, "%s", tstr));