Skip to content

Commit

Permalink
AoE: Fix the uses of the pointer to the end of current packet
Browse files Browse the repository at this point in the history
Must be based on packet header caplen.
  • Loading branch information
fxlb committed Mar 1, 2018
1 parent 19b51de commit 5d938ab
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions print-aoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 5d938ab

Please sign in to comment.