From: Maria Matejka Date: Mon, 10 Mar 2025 18:57:39 +0000 (+0100) Subject: Fix crash on graceful restart of a channel with ROA subscription X-Git-Tag: v3.1.1~23^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae96a6295043f1641be02b5c970cca4e82c4a48b;p=thirdparty%2Fbird.git Fix crash on graceful restart of a channel with ROA subscription Reported by NIX-CZ, thanks! --- diff --git a/nest/proto.c b/nest/proto.c index 61d2b3df2..51b2561e1 100644 --- a/nest/proto.c +++ b/nest/proto.c @@ -563,8 +563,6 @@ channel_roa_subscribe(struct channel *c, rtable *tab, int dir) static void channel_roa_unsubscribe(struct roa_subscription *s) { - struct channel *c = s->c; - RT_LOCKED(s->tab, t) { lfjour_unregister(&s->digest_recipient); @@ -575,8 +573,6 @@ channel_roa_unsubscribe(struct roa_subscription *s) rem_node(&s->roa_node); mb_free(s); - - channel_check_stopped(c); } static void @@ -748,12 +744,12 @@ channel_check_stopped(struct channel *c) proto_send_event(c->proto, c->proto->event); break; + case CS_PAUSE: if (c->obstacles || !EMPTY_LIST(c->roa_subscriptions)) return; ASSERT_DIE(rt_export_get_state(&c->out_req) == TES_DOWN); - ASSERT_DIE(!rt_export_feed_active(&c->reimporter)); channel_set_state(c, CS_START); break; @@ -972,6 +968,8 @@ channel_set_state(struct channel *c, uint state) if (cs == CS_UP) channel_do_pause(c); + + channel_check_stopped(c); break; case CS_STOP: @@ -981,6 +979,7 @@ channel_set_state(struct channel *c, uint state) channel_do_pause(c); channel_do_stop(c); + channel_check_stopped(c); break; case CS_DOWN: