0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-23 10:11:53 +00:00

MRT Table Dump: Fix size of AS_PATH in BGP Attributes

All AS numbers in the AS_PATH attribute in RIB Entries MUST be encoded as 4-byte AS numbers.
 -- RFC 6396

Thanks to Colin Petrie for noticing us about this bug in BIRD!
This commit is contained in:
Pavel Tvrdík 2016-01-05 18:05:06 +01:00
parent b89e7aee8a
commit 5125741512

View File

@ -101,7 +101,11 @@ bgp_mrt_table_dump_step(struct mrt_table_dump_ctx *state)
continue; continue;
} }
attributes_length = bgp_encode_attrs(p, attributes_buffer, e->attrs->eattrs, BGP_ATTR_BUFFER_SIZE); struct bgp_proto tmp_bgp_proto = {
.as4_session = 1, /* to force build AS_PATH as 32bit AS in bgp_encode_attrs() */
};
attributes_length = bgp_encode_attrs(&tmp_bgp_proto, attributes_buffer, e->attrs->eattrs, BGP_ATTR_BUFFER_SIZE);
if (attributes_length == -1) if (attributes_length == -1)
{ {
log(L_WARN "%s: MRT Table Dump for %I/%u: Attribute list too long, let it blank", p->p.name, n->n.prefix, n->n.pxlen); log(L_WARN "%s: MRT Table Dump for %I/%u: Attribute list too long, let it blank", p->p.name, n->n.prefix, n->n.pxlen);