From: Maria Matejka Date: Thu, 12 Oct 2023 07:29:51 +0000 (+0200) Subject: Merge commit '4972590e' into thread-next X-Git-Tag: v3.0.0~397 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b708dd367ace101a72cb09bde0f7597d242fadf1;p=thirdparty%2Fbird.git Merge commit '4972590e' into thread-next --- b708dd367ace101a72cb09bde0f7597d242fadf1 diff --cc nest/proto.c index b0ca57da5,a53257057..5b00cc9d9 --- a/nest/proto.c +++ b/nest/proto.c @@@ -272,11 -177,12 +272,10 @@@ proto_add_channel(struct proto *p, stru c->preference = cf->preference; c->debug = cf->debug; c->merge_limit = cf->merge_limit; - c->in_keep_filtered = cf->in_keep_filtered; + c->in_keep = cf->in_keep; c->rpki_reload = cf->rpki_reload; -- c->bmp_hack = cf->bmp_hack; c->channel_state = CS_DOWN; - c->export_state = ES_DOWN; c->last_state_change = current_time(); c->reloadable = 1; diff --cc proto/bgp/attrs.c index 6fd7abaeb,457a8b152..dfd6f1d3e --- a/proto/bgp/attrs.c +++ b/proto/bgp/attrs.c @@@ -1209,43 -1145,12 +1209,34 @@@ static union bgp_attr_desc bgp_attr_tab }, }; -static inline int -bgp_attr_known(uint code) +eattr * +bgp_find_attr(ea_list *attrs, uint code) +{ + return ea_find(attrs, BGP_EA_ID(code)); +} + +void +bgp_register_attrs(void) { - return (code < ARRAY_SIZE(bgp_attr_table)) && bgp_attr_table[code].name; + for (uint i=0; icount; i++) - { - attrs->attrs[i].flags = bgp_attr_table[EA_ID(attrs->attrs[i].id)].flags; - } - } - + /* * Attribute export */ diff --cc proto/bgp/bgp.h index 7e35b37c1,ceba958c1..cc2b538a9 --- a/proto/bgp/bgp.h +++ b/proto/bgp/bgp.h @@@ -579,20 -556,12 +579,18 @@@ void bgp_store_error(struct bgp_proto * void bgp_stop(struct bgp_proto *p, int subcode, byte *data, uint len); const char *bgp_format_role_name(u8 role); - void bgp_fix_attr_flags(ea_list *attrs); - static inline int -rte_resolvable(rte *rt) +rte_resolvable(const rte *rt) { - return rt->attrs->dest != RTD_UNREACHABLE; + eattr *nhea = ea_find(rt->attrs, &ea_gen_nexthop); + if (!nhea) + return 0; + + struct nexthop_adata *nhad = (void *) nhea->u.ptr; + return NEXTHOP_IS_REACHABLE(nhad) || (nhad->dest != RTD_UNREACHABLE); } +extern struct rte_owner_class bgp_rte_owner_class; #ifdef LOCAL_DEBUG #define BGP_FORCE_DEBUG 1 diff --cc proto/bgp/packets.c index 2c5c04a26,6b11eaf7e..657d5374e --- a/proto/bgp/packets.c +++ b/proto/bgp/packets.c @@@ -2449,13 -2453,13 +2449,12 @@@ bgp_bmp_encode_rte(struct bgp_channel * // struct bgp_proto *p = (void *) c->c.proto; byte *pkt = buf + BGP_HEADER_LENGTH; -- ea_list *attrs = new ? new->attrs->eattrs : NULL; ++ ea_list *attrs = new ? new->attrs : NULL; uint ea_size = new ? (sizeof(ea_list) + attrs->count * sizeof(eattr)) : 0; uint bucket_size = sizeof(struct bgp_bucket) + ea_size; uint prefix_size = sizeof(struct bgp_prefix) + n->length; -- struct lp_state tmpp; -- lp_save(tmp_linpool, &tmpp); ++ struct lp_state *tmpp = lp_save(tmp_linpool); /* Temporary bucket */ struct bgp_bucket *b = tmp_allocz(bucket_size); @@@ -2469,14 -2473,14 +2468,14 @@@ struct bgp_prefix *px = tmp_allocz(prefix_size); px->path_id = src->private_id; net_copy(px->net, n); -- add_tail(&b->prefixes, &px->buck_node); ++ add_tail(&b->prefixes, &px->buck_node_xx); byte *end = bgp_create_update_bmp(c, pkt, b, !!new); if (end) bgp_bmp_prepare_bgp_hdr(buf, end - buf, PKT_UPDATE); -- lp_restore(tmp_linpool, &tmpp); ++ lp_restore(tmp_linpool, tmpp); return end; }