From 5d938abef285623a752b867416f3ce48ba4f9f3e Mon Sep 17 00:00:00 2001 From: Francois-Xavier Le Bail Date: Thu, 1 Mar 2018 16:27:13 +0100 Subject: [PATCH] AoE: Fix the uses of the pointer to the end of current packet Must be based on packet header caplen. --- print-aoe.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/print-aoe.c b/print-aoe.c index 1489b4781..b56af2cb4 100644 --- a/print-aoe.c +++ b/print-aoe.c @@ -142,7 +142,7 @@ static void aoev1_issue_print(netdissect_options *ndo, const u_char *cp, const u_int len) { - const u_char *ep = cp + len; + const u_char *ep = ndo->ndo_snapend; if (len < AOEV1_ISSUE_ARG_LEN) goto invalid; @@ -206,7 +206,7 @@ static void aoev1_query_print(netdissect_options *ndo, const u_char *cp, const u_int len) { - const u_char *ep = cp + len; + const u_char *ep = ndo->ndo_snapend; uint16_t cslen; if (len < AOEV1_QUERY_ARG_LEN) @@ -255,7 +255,7 @@ static void aoev1_mac_print(netdissect_options *ndo, const u_char *cp, const u_int len) { - const u_char *ep = cp + len; + const u_char *ep = ndo->ndo_snapend; uint8_t dircount, i; if (len < AOEV1_MAC_ARG_LEN) @@ -306,7 +306,7 @@ static void aoev1_reserve_print(netdissect_options *ndo, const u_char *cp, const u_int len) { - const u_char *ep = cp + len; + const u_char *ep = ndo->ndo_snapend; uint8_t nmacs, i; if (len < AOEV1_RESERVE_ARG_LEN || (len - AOEV1_RESERVE_ARG_LEN) % MAC_ADDR_LEN) @@ -342,7 +342,7 @@ static void aoev1_print(netdissect_options *ndo, const u_char *cp, const u_int len) { - const u_char *ep = cp + len; + const u_char *ep = ndo->ndo_snapend; uint8_t flags, command; void (*cmd_decoder)(netdissect_options *, const u_char *, const u_int); @@ -399,7 +399,7 @@ void aoe_print(netdissect_options *ndo, const u_char *cp, const u_int len) { - const u_char *ep = cp + len; + const u_char *ep = ndo->ndo_snapend; uint8_t ver; ND_PRINT("AoE length %u", len);