]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #2418 in SNORT/snort3 from ~KBHANDAN/snort3:set_ips_for_pseudo_pdu...
authorBhargava Jandhyala (bjandhya) <bjandhya@cisco.com>
Tue, 1 Sep 2020 19:33:21 +0000 (19:33 +0000)
committerBhargava Jandhyala (bjandhya) <bjandhya@cisco.com>
Tue, 1 Sep 2020 19:33:21 +0000 (19:33 +0000)
Squashed commit of the following:

commit 98bfc2729f03abfccfaad361591fdac5dcdb4705
Author: Kaushal Bhandankar <kbhandan@cisco.com>
Date:   Thu Aug 20 09:47:47 2020 -0400

    ips: use the policies in the flow when creating pseudo packet

src/protocols/packet_manager.cc
src/stream/tcp/tcp_reassembler.cc

index 065de7a3e13d40952188801e77c83e12e4bc45ee..ff9c6efa6fd075f216bef2a3d0356c8dc53bafb0 100644 (file)
@@ -670,6 +670,7 @@ int PacketManager::format_tcp(
     c->user_inspection_policy_id = p->user_inspection_policy_id;
     c->user_ips_policy_id = p->user_ips_policy_id;
     c->user_network_policy_id = p->user_network_policy_id;
+    c->ip_proto_next = p->ip_proto_next;
 
     // setup pkt capture header
     c->pktlen = 0;
index dab3f2d5632dbd22e1bebf1118be03d73b730f27..e85dace90a1105bb386c0fe345654bc2efe780a2 100644 (file)
@@ -829,6 +829,14 @@ static Packet* set_packet(Flow* flow, uint32_t flags, bool c2s)
         p->ptrs.sp = flow->server_port;
         p->ptrs.dp = flow->client_port;
     }
+
+    p->ip_proto_next = (IpProtocol)flow->ip_proto;
+
+    const SnortConfig* sc = SnortConfig::get_conf();
+    set_inspection_policy(sc, flow->inspection_policy_id);
+    set_ips_policy(sc, flow->ips_policy_id);
+    set_network_policy(sc, flow->network_policy_id);
+
     return p;
 }