Rework the logic to not send double notifications in session_notification().
authorclaudio <claudio@openbsd.org>
Wed, 10 Apr 2024 09:05:32 +0000 (09:05 +0000)
committerclaudio <claudio@openbsd.org>
Wed, 10 Apr 2024 09:05:32 +0000 (09:05 +0000)
commit8768446ca08b6a4eb24335c9c27b50cc7633d1ee
tree6508356f12052b495be1be0f54c8ed4c5ede866e
parent8db6b63c06ea7803162d09c566da3a1a7b6d8366
Rework the logic to not send double notifications in session_notification().

last_sent_errcode is now cleared late (when state changes to ESTABLISHED)
and so notifications sent in the OPEN phase would be dropped after the
first incident. Using the session state to know if sending a message is
possible seems more robust and is what session_stop() uses as well.
For now log the notification which are not sent as 'dropping' to see how
often this happens.

OK tb@
usr.sbin/bgpd/session.c