From 7201345a12c62a43d0744a571c75889b5dede999 Mon Sep 17 00:00:00 2001 From: Neil McKee Date: Wed, 30 Oct 2019 08:59:26 -0700 Subject: [PATCH] fix ipv6 extra-header skip --- src/sflowtool.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sflowtool.c b/src/sflowtool.c index 2ea867a..536898b 100644 --- a/src/sflowtool.c +++ b/src/sflowtool.c @@ -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 */ }