From: Josh Date: Tue, 16 Sep 2014 19:18:09 +0000 (-0400) Subject: minor tweak. removing false assertion in packet_manager X-Git-Tag: 3.0.0-233~1411^2~3^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d5b6997760c35899d4ac75991dd467c72bfecae5;p=thirdparty%2Fsnort3.git minor tweak. removing false assertion in packet_manager --- diff --git a/src/framework/codec.h b/src/framework/codec.h index e34fb6b42..b185f1e9a 100644 --- a/src/framework/codec.h +++ b/src/framework/codec.h @@ -63,11 +63,11 @@ namespace icmp enum EncodeType{ ENC_TCP_FIN, ENC_TCP_RST, + ENC_TCP_PUSH, ENC_UNR_NET, ENC_UNR_HOST, ENC_UNR_PORT, ENC_UNR_FW, - ENC_TCP_PUSH, ENC_MAX }; @@ -162,7 +162,7 @@ constexpr uint8_t PKT_TYPE__TCP = 0x02; constexpr uint8_t PKT_TYPE__UDP = 0x04; constexpr uint8_t PKT_TYPE__ICMP4 = 0x08; constexpr uint8_t PKT_TYPE__ICMP6 = 0x10; -constexpr uint8_t PKT_TYPE__ARP = 0x10; +constexpr uint8_t PKT_TYPE__ARP = 0x20; struct SnortData { @@ -186,7 +186,7 @@ struct SnortData inline void reset() { static_assert(PKT_TYPE__UNKOWN == 0, "PKT_TYPE__UNKOWN must be zero!!"); - memset((char*)tcph, '\0', offsetof(SnortData, ip_api)); + memset((char*)&tcph, '\0', offsetof(SnortData, ip_api)); ip_api.reset(); } }; diff --git a/src/protocols/ip.h b/src/protocols/ip.h index f04859054..0cfbb969e 100644 --- a/src/protocols/ip.h +++ b/src/protocols/ip.h @@ -55,6 +55,7 @@ class SO_PUBLIC IpApi public: // IpApi(); constructor and destructor MUST remain a trivial. Adding // ~IpApi(); any non-trivial code will cause a compilation failure. + IpApi() = default ; void set(const IP4Hdr* h4); void set(const IP6Hdr* h6); diff --git a/src/protocols/packet_manager.cc b/src/protocols/packet_manager.cc index ba13bd315..deba3d582 100644 --- a/src/protocols/packet_manager.cc +++ b/src/protocols/packet_manager.cc @@ -148,7 +148,7 @@ void PacketManager::decode( uint16_t prev_prot_id = FINISHED_DECODE; - assert(!(p->packet_flags & PKT_REBUILT_STREAM)); +// assert(!(p->packet_flags & PKT_REBUILT_STREAM)); // initialize all Packet information