From: Katerina Kubecova Date: Thu, 2 Nov 2023 09:04:35 +0000 (+0100) Subject: fixup! fixup! fixup! fixup! fixup! partial import seems working X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0403f0608b55754331d8a7525763585624347c8e;p=thirdparty%2Fbird.git fixup! fixup! fixup! fixup! fixup! partial import seems working --- diff --git a/nest/config.Y b/nest/config.Y index 0b86f6865..f871ac2a5 100644 --- a/nest/config.Y +++ b/nest/config.Y @@ -128,7 +128,8 @@ proto_call_cmd_reload(struct proto_spec ps, int dir, const struct f_trie *trie) if (trie) { /* CLI linpool is moved to trie, because trie is need for longer time - than the linpool would exist in CLI. The linpool is freed in channel_reload_out_done_main */ + * than the linpool would exist in CLI. The linpool is freed in channel_reload_out_done_main. + */ ASSERT_DIE(this_cli->parser_pool == prr->trie->lp); rmove(this_cli->parser_pool, &root_pool); this_cli->parser_pool = lp_new(this_cli->pool); diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index 58d87e1a6..bac1af3af 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -1569,21 +1569,17 @@ bgp_reload_routes(struct channel *C, struct channel_import_request *cir) /* Ignore non-BGP channels */ if (C->class != &channel_bgp) { - if (cir) - cir->done(cir); + cir->done(cir); return 1; } - if (cir) + if (cir->trie) { - if (cir->trie) - { - cir->done(cir); - return 0; - } - /* We do not need cir anymore and later we will not be able to detect when to free it. */ cir->done(cir); + return 0; } + /* We do not need cir anymore and later we will not be able to detect when to free it. */ + cir->done(cir); ASSERT(p->conn && p->route_refresh); bgp_schedule_packet(p->conn, c, PKT_ROUTE_REFRESH); diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c index 47c5303ba..c1635afc6 100644 --- a/proto/ospf/ospf.c +++ b/proto/ospf/ospf.c @@ -436,10 +436,9 @@ static int ospf_reload_routes(struct channel *C, struct channel_import_request *cir) { struct ospf_proto *p = (struct ospf_proto *) C->proto; - if (cir) { - cir->next = p->cir; - p->cir = cir; - } + cir->next = p->cir; + p->cir = cir; + if (p->calcrt == 2) return 1; diff --git a/proto/pipe/pipe.c b/proto/pipe/pipe.c index c2cfa5a18..c473d76d3 100644 --- a/proto/pipe/pipe.c +++ b/proto/pipe/pipe.c @@ -121,8 +121,7 @@ pipe_reload_routes(struct channel *C, struct channel_import_request *cir) channel_request_feeding((C == p->pri) ? p->sec : p->pri, &reload->cfr); } else{ - if(cir) - cir->done(cir); + cir->done(cir); /* Route reload on one channel is just refeed on the other */ channel_request_feeding_dynamic((C == p->pri) ? p->sec : p->pri, CFRT_DIRECT); } diff --git a/proto/rip/rip.c b/proto/rip/rip.c index 0325a6609..50a075144 100644 --- a/proto/rip/rip.c +++ b/proto/rip/rip.c @@ -1166,10 +1166,10 @@ static int rip_reload_routes(struct channel *C, struct channel_import_request *cir) { struct rip_proto *p = (struct rip_proto *) C->proto; - if (cir) { - cir->next = p->cir; - p->cir = cir; - } + + cir->next = p->cir; + p->cir = cir; + if (p->rt_reload) return 1; diff --git a/proto/static/static.c b/proto/static/static.c index 82ab580d5..c31b6268c 100644 --- a/proto/static/static.c +++ b/proto/static/static.c @@ -421,14 +421,11 @@ static_reload_routes(struct channel *C, struct channel_import_request *cir) TRACE(D_EVENTS, "Scheduling route reload"); - if (cir && cir->trie) + if (cir->trie) static_mark_partial(p, cir); else - { - if (cir) - cir->done(cir); static_mark_all(p); - } + return 1; }