From: Maria Matejka Date: Thu, 12 Oct 2023 09:39:56 +0000 (+0200) Subject: Merge commit 'e2f08c38' X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fmq-bmp-backported-fixes;p=thirdparty%2Fbird.git Merge commit 'e2f08c38' --- 88fb91a55600759c85eaeb68889ecb158d90d5ab diff --cc proto/bgp/attrs.c index 4346cd5d4,457a8b152..b7a9fe346 --- a/proto/bgp/attrs.c +++ b/proto/bgp/attrs.c @@@ -1152,20 -1151,6 +1152,12 @@@ bgp_attr_known(uint code return (code < ARRAY_SIZE(bgp_attr_table)) && bgp_attr_table[code].name; } +const char * +bgp_attr_name(uint code) +{ + return (code < ARRAY_SIZE(bgp_attr_table)) ? bgp_attr_table[code].name : NULL; +} + - void bgp_fix_attr_flags(ea_list *attrs) - { - for (u8 i = 0; i < attrs->count; i++) - { - attrs->attrs[i].flags = bgp_attr_table[EA_ID(attrs->attrs[i].id)].flags; - } - } - /* * Attribute export */ diff --cc proto/bgp/packets.c index b7df5a7ad,ff51e309f..1dd49ae10 --- a/proto/bgp/packets.c +++ b/proto/bgp/packets.c @@@ -2495,10 -2471,9 +2474,9 @@@ bgp_bmp_encode_rte(struct bgp_channel * if (attrs) memcpy(b->eattrs, attrs, ea_size); - /* Sham prefix */ - struct bgp_prefix *px = alloca(prefix_size); - *px = (struct bgp_prefix) { }; + /* Temporary prefix */ + struct bgp_prefix *px = tmp_allocz(prefix_size); - px->path_id = src->private_id; + px->path_id = (u32) src->private_id; net_copy(px->net, n); add_tail(&b->prefixes, &px->buck_node);