Skip to content

Commit

Permalink
fix ipv6 extra-header skip
Browse files Browse the repository at this point in the history
  • Loading branch information
sflow committed Oct 30, 2019
1 parent fe61334 commit 7201345
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/sflowtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1724,12 +1724,11 @@ static void decodeIPV6(SFSample *sample)
/* nextHeader == 50 => encryption - don't bother coz we'll not be able to read any further */
nextHeader == 51 || /* auth */
nextHeader == 60) { /* destination options */
uint32_t optionLen, skip;
uint32_t optionLen;
sf_logf_U32(sample, "IP6HeaderExtension", nextHeader);
nextHeader = ptr[0];
optionLen = 8 * (ptr[1] + 1); /* second byte gives option len in 8-byte chunks, not counting first 8 */
skip = optionLen - 2;
ptr += skip;
ptr += optionLen;
if(ptr > end) return; /* ran off the end of the header */
}

Expand Down

0 comments on commit 7201345

Please sign in to comment.