Move Conn::set_conn() from connection_state_remove to new_connection

c$conn is often needed for connection events, but it being established
in connection_state_removed can be a problem because event handlers have
to remember to call Con::set_conn().

This commit moves to call Conn::set_conn() in new_connection.

Addresses GH-4202

update logs
This commit is contained in:
Johanna Amann 2025-07-23 09:06:55 +01:00
parent 96f9cc73c3
commit 3e4f67e67c
26 changed files with 4188 additions and 4112 deletions

View file

@ -12,8 +12,6 @@ redef record Info += {
};
event new_connection(c: connection) &priority=5 {
# In case we're the first access
Conn::set_conn(c, F);
if ( c$conn?$ip_proto && c$conn$ip_proto in IP::protocol_names )
c$conn$ip_proto_name = IP::protocol_names[c$conn$ip_proto];
}