From 5e30d6e29ea5611ad4447436179410c7af51184c Mon Sep 17 00:00:00 2001 From: dmiller Date: Sun, 29 Dec 2019 05:15:10 +0000 Subject: [PATCH] Fix loop flow. #1834 --- libnetutil/PacketParser.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libnetutil/PacketParser.cc b/libnetutil/PacketParser.cc index 0f5dabe20..82dce4b0a 100644 --- a/libnetutil/PacketParser.cc +++ b/libnetutil/PacketParser.cc @@ -729,12 +729,10 @@ int PacketParser::payload_offset(const u8 *pkt, size_t pktlen, bool link_include /* When we find application data, we compute the offset by substacting the length of the application data from the packet's total length */ if(me->protocol_id()==HEADER_TYPE_RAW_DATA){ - offset=pktlen-me->getLen(); + offset = pktlen - me->getLen(); break; - me=me->getNextElement(); - }else{ - me=me->getNextElement(); } + me = me->getNextElement(); } /* Free the structs */