Merge in SNORT/snort3 from ~CHSHERWI/snort3:vlan_fix2 to master
Squashed commit of the following:
commit
d89e24f57bca7d1f9af03858b5c7069d84039fce
Author: Chris Sherwin <chsherwi@cisco.com>
Date: Thu Apr 27 15:15:15 2023 -0400
stream tcp: Populate TCP pseudopackets with VLAN ids in TCP reassembler to avoid
issues with secondary flow creation / expected flow cache
rt->update_last_seen();
const uint8_t* mac;
- if ( layer::get_eth_layer(p) )
+ if ( !(p->packet_flags & PKT_REBUILT_STREAM ) && layer::get_eth_layer(p) )
{
if ( p->is_from_server() )
mac = layer::get_eth_layer(p)->ether_dst;
pdu->data = nullptr;
pdu->ip_proto_next = (IpProtocol)p->flow->ip_proto;
+
+ if ( p->proto_bits & PROTO_BIT__VLAN )
+ {
+ memcpy( pdu->layers, p->layers, p->num_layers * sizeof(Layer));
+ pdu->num_layers = p->num_layers;
+ pdu->proto_bits |= PROTO_BIT__VLAN;
+ pdu->vlan_idx = p->vlan_idx;
+ }
+
return pdu;
}