]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
All events are required to have their hook
authorMaria Matejka <mq@ucw.cz>
Wed, 21 May 2025 08:15:49 +0000 (10:15 +0200)
committerMaria Matejka <mq@ucw.cz>
Sun, 25 May 2025 19:02:51 +0000 (21:02 +0200)
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.

lib/event.c

index 79b8eb2cfb92d8844e0240301c2caa940dff06ce..d71f81f45c4b5b186b160b5f94a1b456625976c3 100644 (file)
@@ -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(