[quagga-dev 11277] Re: [PATCH] bgpd: bgpd-cmp-originator-id-in-attr-hash.patch

David Lamparter equinox at opensourcerouting.org
Thu May 15 19:10:48 BST 2014


On Sat, Sep 07, 2013 at 01:13:37AM -0700, Pradosh Mohapatra wrote:
> BGP: Advertise the correct originator-id in reflected routes
> 
> ISSUE:
> 
> Suppose route1 and route2 received from route-reflector-client1 and client2
> respectively have identical attributes. The current logic of creating the
> adj-rib-out for a peer threads the 'adv' structures for both routes against
> the same attribute. This results in 'bgp_update_packet()' to pack those
> routes in the same UPDATE message with one attr structure formatted. The
> originator-id is thus set according to the first route's received router id.
> This is incorrect.
> 
> PATCH:
> 
> Fix bgp_announce_check() function to set the originator-id in the
> advertising attr structure. Also, fix the attribute hash function and
> compare function to consider originator-id. Otherwise attributes where all
> fields except the originator-id are identical get merged into one memory
> location.
> 
> Signed-off-by: Pradosh Mohapatra <pmohapat at cumulusnetworks.com>
> Reviewed-by: Scott Feldman <sfeldma at cumulusnetworks.com>
> Reviewed-by: Ken Yin <kyin at cumulusnetworks.com>

Applied, thanks!

I've removed the following 2 whitespace-only chunks:
(Whitespace should only be improved in/near lines that are changed
anyway, not completely independent.)

> @@ -421,7 +422,7 @@ attrhash_cmp (const void *p1, const void *p2)
>      {
>        const struct attr_extra *ae1 = attr1->extra;
>        const struct attr_extra *ae2 = attr2->extra;
> -      
> +
>        if (ae1 && ae2
>            && ae1->aggregator_as == ae2->aggregator_as
>            && ae1->aggregator_addr.s_addr == ae2->aggregator_addr.s_addr
> @@ -811,7 +811,7 @@ bgp_announce_check (struct bgp_info *ri, struct peer *peer, struct prefix *p,
>    filter = &peer->filter[afi][safi];
>    bgp = peer->bgp;
>    riattr = bgp_info_mpath_count (ri) ? bgp_info_mpath_attr (ri) : ri->attr;
> -  
> +
>    if (DISABLE_BGP_ANNOUNCE)
>      return 0;




More information about the Quagga-dev mailing list