Merge in SNORT/snort3 from ~KUMHN/snort3:automation_crash to master
Squashed commit of the following:
commit
858982dde3b99249dac7191f21d08a713fbaa350
Author: kumhn <kumhn@cisco.com>
Date: Wed May 15 11:16:09 2024 +0530
dce_smb: Do not prune from LRU cache during file tracker update
const uint32_t tid, const uint32_t mid, DCE2_Smb2SessionTracker** str, DCE2_Smb2TreeTracker** ttr, bool
lookup_cache = false)
{
- if(lookup_cache)
- {
- auto key = get_key(sid);
- *str = smb2_session_cache->find(key).get();
- }
- else
- {
- *str = DCE2_Smb2FindSidInSsd(ssd, sid).get();
- }
+ *str = DCE2_Smb2FindSidInSsd(ssd, sid).get();
if (!*str)
{
if (lookup_cache)
int16_t sgroup = 0;
uint32_t addressSpaceId = 0;
uint16_t vlan_tag = 0;
- uint16_t padding = 0;
+ uint16_t dport = 0;
uint64_t sid = 0;
uint32_t tenant_id = 0;
uint32_t padding2 = 0; // NOTE: If this changes, change do_hash too
addressSpaceId == other.addressSpaceId and
vlan_tag == other.vlan_tag and
sid == other.sid and
+ dport == other.dport and
tenant_id == other.tenant_id );
}
};
mix(a, b, c);
- a += d[12]; // vlan & pad
+ a += d[12]; // vlan & dport
b += d[13]; // ip_proto, pkt_type, version, flags
finalize(a, b, c);
memcpy(key.cip, flow->client_ip.get_ip6_ptr(), 4 * sizeof(uint32_t));
memcpy(key.sip, flow->server_ip.get_ip6_ptr(), 4 * sizeof(uint32_t));
key.mplsLabel = flow->key->mplsLabel;
+ key.dport = flow->server_port;
key.cgroup = flow->client_group;
key.sgroup = flow->server_group;
key.addressSpaceId = flow->key->addressSpaceId;
current_size += size;
if ( size > 0)
{
- // Checking 1+ size prevents crash if max_size is too low to hold even a single entry
- if ( current_size > max_size and list.size() > 1 )
- LruLocal::prune();
if ( stats.cache_max < current_size )
stats.cache_max = current_size;
}