]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
fixing ethernet codec. Will now legiimatelyl decode packets
authorJosh <jrosenba@cisco.com>
Thu, 24 Apr 2014 22:09:53 +0000 (18:09 -0400)
committerJosh <jrosenba@cisco.com>
Thu, 24 Apr 2014 22:09:53 +0000 (18:09 -0400)
cmake/createCommandLineOptions.txt
src/codecs/basic/cd_eth.cc
src/codecs/basic/cd_udp.cc

index 8453ad20b60548462fdf31a1b27a5e4ce9f6e2e4..b854cfb0c3a66bc14be1c89c8cd128739322a959 100644 (file)
@@ -12,7 +12,7 @@ option (STATIC_IPS_OPTIONS "include ips options in binary" ON)
 option (STATIC_SEARCH_ENGINES "include search engines in binary" ON)
 option (BUILD_CONTROL_SOCKET "Enable the control socket (Linux only)" OFF)
 option (BUILD_SIDE_CHANNEL "Enable the side channel (Linux only)" OFF)
-option (ENABLE_STATIC_DAQ "Link static DAQ modules" OFF)
+option (ENABLE_STATIC_DAQ "Link static DAQ modules" ON)
 option (ENABLE_VALGRIND "Only use if you are testing with valgrind" OFF)
 option (ENABLE_PPM "Disable packet/rule performance monitor" ON)
 option (ENABLE_PPM_TEST "Enable packet/rule performance monitor for readback" OFF)
index 25c8036fa99a10e249b60c877827f2b8d5476792..3982921c3351f3827f6091f8b36a3c7c6c5f5ee3 100644 (file)
@@ -124,10 +124,10 @@ bool EthCodec::decode(const uint8_t *raw_pkt, const uint32_t len,
                 ntohs(p->eh->ether_type), p->pkth->pktlen)
             );
 
+    next_prot_id = ntohs(p->eh->ether_type);
 
-    if (len > MIN_ETHERTYPE )
+    if (next_prot_id > MIN_ETHERTYPE )
     {
-        next_prot_id = ntohs(p->eh->ether_type);
         hdr_len = eth::hdr_len();
         return true;
     }
index 334d745e0765f135d5b27c121990fa239954c716..2ec025a8794da686c8b562322b00c20344451cfb 100644 (file)
@@ -235,7 +235,6 @@ bool UdpCodec::decode(const uint8_t *raw_pkt, const uint32_t len,
     DEBUG_WRAP(DebugMessage(DEBUG_DECODE, "UDP header starts at: %p\n", p->udph););
 
     p_hdr_len = udp::header_len();
-    next_prot_id = -1;
 //    PushLayer(PROTO_UDP, p, raw_pkt, udp::header_len());