]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #4510: stream_tcp: initialize the daq_instance field in the meta-ack...
authorDavis McPherson -X (davmcphe - XORIANT CORPORATION at Cisco) <davmcphe@cisco.com>
Tue, 19 Nov 2024 00:39:30 +0000 (00:39 +0000)
committerSteven Baigal (sbaigal) <sbaigal@cisco.com>
Tue, 19 Nov 2024 00:39:30 +0000 (00:39 +0000)
Merge in SNORT/snort3 from ~DAVMCPHE/snort3:meta_ack_init_daq_instance to master

Squashed commit of the following:

commit c46a154c9f67df88376fb9ac999b6602c9fa5e72
Author: davis mcpherson <davmcphe@cisco.com>
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

src/stream/tcp/tcp_reassembler.cc
src/stream/tcp/tcp_segment_descriptor.cc
src/stream/tcp/tcp_session.cc

index ab9975719380845dee1725736f493dc9dd8060ec..70c8f879acc10631ec778d8a7b78e6062fcd8a70 100644 (file)
@@ -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;
index 1349891614a05fe2ecdb99190cbf0ebfb8a82931..c1662257cca1488be0a1b36f4553097109de7bca 100644 (file)
@@ -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();
index 7e720d0d946556de96b07113fe4a50fe85a290d0..68e6e9ce0970b5325df2718826717740bb7cd43b 100644 (file)
@@ -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);