From: Maria Matejka Date: Mon, 10 Mar 2025 09:16:50 +0000 (+0100) Subject: Merge commit '6a55359b1' into thread-next X-Git-Tag: v3.1.0~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb8ee3e95c1b5fd402a72fc4555bb7de3a8e79bf;p=thirdparty%2Fbird.git Merge commit '6a55359b1' into thread-next --- eb8ee3e95c1b5fd402a72fc4555bb7de3a8e79bf diff --cc proto/bgp/bgp.c index 859f7bc16,c18a73feb..0e610c9e0 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@@ -978,29 -806,13 +979,32 @@@ bgp_handle_graceful_restart(struct bgp_ /* p->gr_ready -> at least one active channel is c->gr_ready */ ASSERT(p->gr_active_num > 0); + uint gr_time = CLAMP(p->conn->remote_caps->gr_time, + p->cf->min_gr_time, p->cf->max_gr_time); + proto_notify_state(&p->p, PS_START); - tm_start_in(p->gr_timer, p->conn->remote_caps->gr_time S, p->p.loop); - tm_start(p->gr_timer, gr_time S); ++ tm_start_in(p->gr_timer, gr_time S, p->p.loop); +} + + +static void +bgp_graceful_restart_feed(struct bgp_channel *c) +{ + c->stale_feed = (struct rt_export_feeder) { + .name = mb_sprintf(c->c.proto->pool, "%s.%s.llgr", c->c.proto->name, c->c.name), + .trace_routes = c->c.debug, + }; + c->stale_event = (event) { + .hook = bgp_rte_modify_stale, + .data = c, + }; + + rt_feeder_subscribe(&c->c.table->export_all, &c->stale_feed); + proto_send_event(c->c.proto, &c->stale_event); } + + /** * bgp_graceful_restart_done - finish active BGP graceful restart * @c: BGP channel diff --cc proto/bgp/bgp.h index dac6e84ea,bd6fe2de4..4b1f75ba6 --- a/proto/bgp/bgp.h +++ b/proto/bgp/bgp.h @@@ -145,8 -150,7 +149,8 @@@ struct bgp_config int require_extended_messages; /* Require remote support for extended messages [RFC 8654] */ int require_hostname; /* Require remote support for hostname [draft] */ int require_gr; /* Require remote support for graceful restart [RFC 4724] */ - int require_llgr; /* Require remote support for long-lived graceful restart [draft] */ + int require_llgr; /* Require remote support for long-lived graceful restart [RFC 9494] */ + uint tx_size_warning; /* The maximum amount of memory which is not logged as warning */ struct bfd_options *bfd; /* Use BFD for liveness detection */ }; diff --cc proto/bgp/config.Y index aafd44ff7,222879e94..4892eeaac --- a/proto/bgp/config.Y +++ b/proto/bgp/config.Y @@@ -29,11 -30,9 +29,12 @@@ CF_KEYWORDS(BGP, LOCAL, NEIGHBOR, AS, H GRACEFUL, RESTART, AWARE, CHECK, LINK, PORT, EXTENDED, MESSAGES, SETKEY, STRICT, BIND, CONFEDERATION, MEMBER, MULTICAST, FLOW4, FLOW6, LONG, LIVED, STALE, IMPORT, IBGP, EBGP, MANDATORY, INTERNAL, EXTERNAL, SETS, - DYNAMIC, RANGE, NAME, DIGITS, BGP_AIGP, AIGP, ORIGINATE, COST, ENFORCE, + DYNAMIC, RANGE, NAME, DIGITS, AIGP, ORIGINATE, COST, ENFORCE, FIRST, FREE, VALIDATE, BASE, ROLE, ROLES, PEER, PROVIDER, CUSTOMER, - RS_SERVER, RS_CLIENT, REQUIRE, BGP_OTC, GLOBAL, SEND, TX, SIZE, WARNING) - RS_SERVER, RS_CLIENT, REQUIRE, BGP_OTC, GLOBAL, SEND, MIN, MAX) ++ RS_SERVER, RS_CLIENT, REQUIRE, BGP_OTC, GLOBAL, SEND, TX, SIZE, WARNING, ++ MIN, MAX) + +CF_ENUM(T_ENUM_BGP_ORIGIN, ORIGIN_, IGP, EGP, INCOMPLETE) %type bgp_nh %type bgp_afi @@@ -267,8 -271,9 +276,10 @@@ bgp_channel_start: bgp_af BGP_CC->gr_able = 0xff; /* undefined */ BGP_CC->llgr_able = 0xff; /* undefined */ BGP_CC->llgr_time = ~0U; /* undefined */ + BGP_CC->min_llgr_time = ~0U; /* undefined */ + BGP_CC->max_llgr_time = ~0U; /* undefined */ BGP_CC->aigp = 0xff; /* undefined */ + BGP_CC->ptx_exporter_settle = (struct settle_config) { 10 MS_, 100 MS_ }; } };