]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
BGP: Fix crash on listening socket failure
authorMaria Matejka <mq@ucw.cz>
Sun, 29 Jun 2025 16:56:27 +0000 (18:56 +0200)
committerMaria Matejka <mq@ucw.cz>
Sun, 29 Jun 2025 16:58:37 +0000 (18:58 +0200)
In that specific case, bgp_stop() runs from the main loop, effectively
causing the deferred state announcement to run from a bad context.
Fixed by forcibly announcing the state immediately.

proto/bgp/bgp.c

index adfa74f973719bd76e49a3a3be8052b2dd38ccec..d55c58ae01b679b017ccdd0a148ccad7d999c7e5 100644 (file)
@@ -876,6 +876,7 @@ bgp_initiate_disable(struct bgp_proto *p, int err_val)
        p->p.disabled = 1;
        bgp_store_error(p, NULL, BE_MISC, err_val);
        bgp_stop(p, err_val, NULL, 0);
+       proto_announce_state(&p->p, p->p.ea_state);
     }
   }
 }