From: Josh Date: Wed, 30 Apr 2014 13:46:18 +0000 (-0400) Subject: Refactor packet manager X-Git-Tag: 3.0.0-233~1542^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e10779f8c0502eb4461df5de3dbc980862ff9d7f;p=thirdparty%2Fsnort3.git Refactor packet manager --- diff --git a/src/codecs/basic/cd_udp.cc b/src/codecs/basic/cd_udp.cc index b6ef15ee8..7cf44976e 100644 --- a/src/codecs/basic/cd_udp.cc +++ b/src/codecs/basic/cd_udp.cc @@ -46,7 +46,7 @@ namespace class UdpCodec : public Codec { public: - UdpCodec() : Codec("Udp"){}; + UdpCodec() : Codec("udp"){}; ~UdpCodec(){}; @@ -102,7 +102,7 @@ bool UdpCodec::decode(const uint8_t *raw_pkt, const uint32_t len, } /* set the ptr to the start of the UDP header */ - p->inner_udph = p->udph = reinterpret_cast(const_cast(raw_pkt)); + p->inner_udph = p->udph = reinterpret_cast(raw_pkt); if (!p->frag_flag) { diff --git a/src/managers/packet_manager.cc b/src/managers/packet_manager.cc index eb601f5ca..844785efc 100644 --- a/src/managers/packet_manager.cc +++ b/src/managers/packet_manager.cc @@ -340,7 +340,7 @@ void PacketManager::decode( } // if the final codec returned false && is not the null codec - if (!valid && mapped_prot) + if (!valid && (mapped_prot != FINISHED_DECODE)) pkt_cnt.discards++; // If a codec attempted to decode another layer but we couldn't find it