policy/community-id: Populate conn$community_id in new_connection()

This wasn't possible before #3028 was fixed, but now it's safe to set
the value in new_connection() and allow other users access to the
field much earlier. We do not have to deal with connection_flipped()
because the community-id hash is symmetric.
This commit is contained in:
Arne Welzel 2024-11-08 18:19:02 +01:00
parent 0a7c9365be
commit cb679e4d7a
7 changed files with 39 additions and 3 deletions

View file

@ -17,7 +17,10 @@ export {
};
}
event connection_state_remove(c: connection)
module Conn;
event new_connection(c: connection) &priority=5
{
Conn::set_conn(c, F); # likely first to access :-/
c$conn$community_id = community_id_v1(c$id, CommunityID::seed, CommunityID::do_base64);
}