mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00

This introduces a new sampling state-map for expired connections to fix segfaults that previously occured when passing in a `connection` record to `Reporter::conn_weird()` for which the internal `Connection` object had already been expired and deleted. This also introduces a new event called `expired_conn_weird`, which is similar to `conn_weird`, except the full `connection` record is no longer available, just the `conn_id` and UID string.
22 lines
565 B
Text
22 lines
565 B
Text
# @TEST-EXEC: zeek -b -r $TRACES/rdp/rdp-to-ssl.pcap %INPUT >out
|
|
# @TEST-EXEC: btest-diff out
|
|
|
|
redef Weird::sampling_threshold = 2;
|
|
|
|
event my_event(c: connection)
|
|
{
|
|
Reporter::conn_weird("test!", c, "test2");
|
|
Reporter::conn_weird("test!", c, "test2");
|
|
Reporter::conn_weird("test!", c, "test2");
|
|
Reporter::conn_weird("test!", c, "test2");
|
|
}
|
|
|
|
event connection_state_remove(c: connection)
|
|
{
|
|
schedule 1sec { my_event(c) };
|
|
}
|
|
|
|
event expired_conn_weird(name: string, id: conn_id, uid: string, addl: string)
|
|
{
|
|
print "expired_conn_weird", name, id, uid, addl;
|
|
}
|