]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Refactor packet manager
authorJosh <jrosenba@cisco.com>
Wed, 30 Apr 2014 13:46:18 +0000 (09:46 -0400)
committerJosh <jrosenba@cisco.com>
Wed, 30 Apr 2014 13:46:18 +0000 (09:46 -0400)
src/codecs/basic/cd_udp.cc
src/managers/packet_manager.cc

index b6ef15ee80dd23ea0b579c46735b194ba7065bdf..7cf44976ee3e83d174576f38bf9844a958bf766b 100644 (file)
@@ -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<udp::UDPHdr*>(const_cast<uint8_t*>(raw_pkt));
+    p->inner_udph = p->udph = reinterpret_cast<const udp::UDPHdr*>(raw_pkt);
 
     if (!p->frag_flag)
     {
index eb601f5ca725a972dee287e2067559b9d6eecaa4..844785efc22eb880628639cf414761706a3e0eba 100644 (file)
@@ -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