return (code < ARRAY_SIZE(bgp_attr_table)) && bgp_attr_table[code].name;
}
- 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;
- }
- }
-
+const char *
+bgp_attr_name(uint code)
+{
+ return (code < ARRAY_SIZE(bgp_attr_table)) ? bgp_attr_table[code].name : NULL;
+}
+
/*
* Attribute export
*/
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);