Skip to content

Commit 5d938ab

Browse files
committed
AoE: Fix the uses of the pointer to the end of current packet
Must be based on packet header caplen.
1 parent 19b51de commit 5d938ab

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

print-aoe.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ static void
142142
aoev1_issue_print(netdissect_options *ndo,
143143
const u_char *cp, const u_int len)
144144
{
145-
const u_char *ep = cp + len;
145+
const u_char *ep = ndo->ndo_snapend;
146146

147147
if (len < AOEV1_ISSUE_ARG_LEN)
148148
goto invalid;
@@ -206,7 +206,7 @@ static void
206206
aoev1_query_print(netdissect_options *ndo,
207207
const u_char *cp, const u_int len)
208208
{
209-
const u_char *ep = cp + len;
209+
const u_char *ep = ndo->ndo_snapend;
210210
uint16_t cslen;
211211

212212
if (len < AOEV1_QUERY_ARG_LEN)
@@ -255,7 +255,7 @@ static void
255255
aoev1_mac_print(netdissect_options *ndo,
256256
const u_char *cp, const u_int len)
257257
{
258-
const u_char *ep = cp + len;
258+
const u_char *ep = ndo->ndo_snapend;
259259
uint8_t dircount, i;
260260

261261
if (len < AOEV1_MAC_ARG_LEN)
@@ -306,7 +306,7 @@ static void
306306
aoev1_reserve_print(netdissect_options *ndo,
307307
const u_char *cp, const u_int len)
308308
{
309-
const u_char *ep = cp + len;
309+
const u_char *ep = ndo->ndo_snapend;
310310
uint8_t nmacs, i;
311311

312312
if (len < AOEV1_RESERVE_ARG_LEN || (len - AOEV1_RESERVE_ARG_LEN) % MAC_ADDR_LEN)
@@ -342,7 +342,7 @@ static void
342342
aoev1_print(netdissect_options *ndo,
343343
const u_char *cp, const u_int len)
344344
{
345-
const u_char *ep = cp + len;
345+
const u_char *ep = ndo->ndo_snapend;
346346
uint8_t flags, command;
347347
void (*cmd_decoder)(netdissect_options *, const u_char *, const u_int);
348348

@@ -399,7 +399,7 @@ void
399399
aoe_print(netdissect_options *ndo,
400400
const u_char *cp, const u_int len)
401401
{
402-
const u_char *ep = cp + len;
402+
const u_char *ep = ndo->ndo_snapend;
403403
uint8_t ver;
404404

405405
ND_PRINT("AoE length %u", len);

0 commit comments

Comments
 (0)