From: Davis McPherson -X (davmcphe - XORIANT CORPORATION at Cisco) Date: Tue, 19 Nov 2024 00:39:30 +0000 (+0000) Subject: Pull request #4510: stream_tcp: initialize the daq_instance field in the meta-ack... X-Git-Tag: 3.5.2.0~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=477e68d3521d951cbc8f8c142e61523b99484696;p=thirdparty%2Fsnort3.git Pull request #4510: stream_tcp: initialize the daq_instance field in the meta-ack pseudo-packet Merge in SNORT/snort3 from ~DAVMCPHE/snort3:meta_ack_init_daq_instance to master Squashed commit of the following: commit c46a154c9f67df88376fb9ac999b6602c9fa5e72 Author: davis mcpherson Date: Wed Nov 6 11:19:17 2024 -0500 stream_tcp: initialize the daq_instance field in the Packet instance allocated for a meta-ack to the value from the wire packet --- diff --git a/src/stream/tcp/tcp_reassembler.cc b/src/stream/tcp/tcp_reassembler.cc index ab9975719..70c8f879a 100644 --- a/src/stream/tcp/tcp_reassembler.cc +++ b/src/stream/tcp/tcp_reassembler.cc @@ -264,6 +264,7 @@ Packet* TcpReassembler::initialize_pdu(Packet* p, uint32_t pkt_flags, struct tim { // partial flushes already set the pdu for http_inspect splitter processing Packet* pdu = p->was_set() ? p : DetectionEngine::set_next_packet(p); + assert( pdu->daq_msg == p->daq_msg and pdu->daq_instance == p->daq_instance ); EncodeFlags enc_flags = 0; DAQ_PktHdr_t pkth; diff --git a/src/stream/tcp/tcp_segment_descriptor.cc b/src/stream/tcp/tcp_segment_descriptor.cc index 134989161..c1662257c 100644 --- a/src/stream/tcp/tcp_segment_descriptor.cc +++ b/src/stream/tcp/tcp_segment_descriptor.cc @@ -97,6 +97,7 @@ TcpSegmentDescriptor::TcpSegmentDescriptor pkt->context = p->context; pkt->dsize = 0; pkt->daq_msg = p->daq_msg; + pkt->daq_instance = p->daq_instance; seq = tcph->seq(); ack = tcph->ack(); diff --git a/src/stream/tcp/tcp_session.cc b/src/stream/tcp/tcp_session.cc index 7e720d0d9..68e6e9ce0 100644 --- a/src/stream/tcp/tcp_session.cc +++ b/src/stream/tcp/tcp_session.cc @@ -1050,7 +1050,8 @@ int TcpSession::process(Packet* p) if ( tcp_mack ) { TcpSegmentDescriptor ma_tsd(flow, p, tcp_mack->tcp_ack_seq_num, tcp_mack->tcp_window_size); - assert( ma_tsd.get_pkt()->daq_msg && ma_tsd.get_pkt()->daq_msg == p->daq_msg ); + assert( ma_tsd.get_pkt()->daq_msg and ma_tsd.get_pkt()->daq_msg == p->daq_msg ); + assert( ma_tsd.get_pkt()->daq_instance and ma_tsd.get_pkt()->daq_instance == p->daq_instance ); init_tcp_packet_analysis(ma_tsd); process_tcp_packet(ma_tsd, p);