From: Maria Matejka Date: Sun, 28 Jan 2024 14:00:59 +0000 (+0100) Subject: Merge commit 'v2.14-92-gf27b05de' into thread-next X-Git-Tag: v3.0.0~284 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b4f53675ea375f2fbd50a872735486992de8c8c;p=thirdparty%2Fbird.git Merge commit 'v2.14-92-gf27b05de' into thread-next --- 8b4f53675ea375f2fbd50a872735486992de8c8c diff --cc proto/bgp/bgp.c index dd47eb600,b14df932f..9de97181a --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@@ -2378,17 -2188,30 +2399,28 @@@ bgp_reconfigure(struct proto *P, struc if (C->stale) same = proto_configure_channel(P, &C, NULL) && same; - if (same && (p->start_state > BSS_PREPARE)) - bgp_update_bfd(p, new->bfd); + /* Reset name counter */ + p->dynamic_name_counter = 0; + + if (!same) + return 0; /* We should update our copy of configuration ptr as old configuration will be freed */ - if (same) - p->cf = new; + p->cf = new; - /* Reset name counter */ - p->dynamic_name_counter = 0; + /* Check whether existing connections are compatible with required capabilities */ + struct bgp_conn *ci = &p->incoming_conn; + if (((ci->state == BS_OPENCONFIRM) || (ci->state == BS_ESTABLISHED)) && !bgp_check_capabilities(ci)) + return 0; + + struct bgp_conn *co = &p->outgoing_conn; + if (((co->state == BS_OPENCONFIRM) || (co->state == BS_ESTABLISHED)) && !bgp_check_capabilities(co)) + return 0; - return same; - proto_setup_mpls_map(P, RTS_BGP, 1); - + if (p->start_state > BSS_PREPARE) + bgp_update_bfd(p, new->bfd); + + return 1; } #define TABLE(cf, NAME) ((cf)->NAME ? (cf)->NAME->table : NULL )