From: Maria Matejka Date: Wed, 21 May 2025 08:15:49 +0000 (+0200) Subject: All events are required to have their hook X-Git-Tag: v3.1.2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00562a5eb217ea9c0feadfe9391a427dc0442637;p=thirdparty%2Fbird.git All events are required to have their hook This is quite an obvious requirement but it wasn't enforced properly, leading to unnecessarily tedious debugging when an uninitialized event is improperly enqueued. Now BIRD is going to crash as soon as somebody tries to enqueue such an event, not when trying to execute nothing from a clean context. Would have helped with #238. --- diff --git a/lib/event.c b/lib/event.c index 79b8eb2cf..d71f81f45 100644 --- a/lib/event.c +++ b/lib/event.c @@ -236,7 +236,9 @@ ev_run(event *e) inline void ev_send(event_list *l, event *e) { + ASSERT_DIE(e->hook); edlog(l, e, NULL, 1, EDL_SEND); + /* Set the target list */ event_list *ol = NULL; if (!atomic_compare_exchange_strong_explicit(