Mailing List Archive

Question about BGP_ATR_LARGE_COMMUNITIES in bgp_dump_routes_attr (potential bug)
Good afternoon,

I was browsing through the latest Quagga code, and noticed what I think is a discrepancy in the function bgp_dump_routes_attr. There is a stanza dealing with large communities that looks like this, on line 3221 of bgpd/bgp_attr.c:

if (attr->extra && attr->flag & ATTR_FLAG_BIT (BGP_ATTR_LARGE_COMMUNITIES))
if (attr->extra->lcommunity->size * 12 > 255)
stream_putc (s, BGP_ATTR_COMMUNITIES);
stream_putw (s, attr->extra->lcommunity->size * 12);
stream_putc (s, BGP_ATTR_COMMUNITIES);
stream_putc (s, attr->extra->lcommunity->size * 12);

stream_put (s, attr->extra->lcommunity->val, attr->extra->lcommunity->size * 12);

I would expect the second "stream_putc" line in each case to look like this instead:

This is in line with the function bgp_packet_attribute(), which is above the function in question.

I admit that I don't have a complete grasp of the code in this file --it's possible that there is a legitimate reason for both COMMUNITIES and LARGE_COMMUNITIES to have the same attribute in this function (as far as I could trace it, it seems like it might be used for mrt dumps?). But I thought I'd notify the list just in case this is a bug.

Seth Hetu

Quagga-dev mailing list