From: Ondrej Zajicek Date: Thu, 6 Mar 2025 15:09:36 +0000 (+0100) Subject: BGP: Fix reconfiguration of hostname option X-Git-Tag: v2.17~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=93224ddd302f5426b9700b1a2ef8c643760e48e9;p=thirdparty%2Fbird.git BGP: Fix reconfiguration of hostname option The old code did not properly compare and update hostname strings, causing BGP restarts during reconfigurations. --- diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index e17f47ae0..7ae03a06a 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -2217,7 +2217,7 @@ bgp_reconfigure(struct proto *P, struct proto_config *CF) if (proto_get_router_id(CF) != p->local_id) return 0; - if (proto_get_hostname(CF) != p->hostname) + if (bstrcmp(proto_get_hostname(CF), p->hostname)) return 0; int same = !memcmp(((byte *) old) + sizeof(struct proto_config), @@ -2259,6 +2259,7 @@ bgp_reconfigure(struct proto *P, struct proto_config *CF) /* We should update our copy of configuration ptr as old configuration will be freed */ p->cf = new; + p->hostname = proto_get_hostname(CF); /* Check whether existing connections are compatible with required capabilities */ struct bgp_conn *ci = &p->incoming_conn;