]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: Honor origin change in bgp aggregates
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 10 Sep 2018 14:19:03 +0000 (10:19 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 10 Sep 2018 14:19:03 +0000 (10:19 -0400)
When the origin changed we must honor and update the aggregate
to the peer.  This code adds a bit of code to the bgp_aggregate_info_same
code to see if the origin has changed and to indicate that it has.

Fixes: #2993
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_route.c

index 32506623c79f97bc12b1df83e3124951875ffddb..2107d1f9f9a18ff6e6adfd9a19ca81152655850a 100644 (file)
@@ -5456,7 +5456,8 @@ static void bgp_aggregate_free(struct bgp_aggregate *aggregate)
        XFREE(MTYPE_BGP_AGGREGATE, aggregate);
 }
 
-static int bgp_aggregate_info_same(struct bgp_info *ri, struct aspath *aspath,
+static int bgp_aggregate_info_same(struct bgp_info *ri, uint8_t origin,
+                                  struct aspath *aspath,
                                   struct community *comm)
 {
        static struct aspath *ae = NULL;
@@ -5467,6 +5468,9 @@ static int bgp_aggregate_info_same(struct bgp_info *ri, struct aspath *aspath,
        if (!ri)
                return 0;
 
+       if (origin != ri->attr->origin)
+               return 0;
+
        if (!aspath_cmp(ri->attr->aspath, (aspath) ? aspath : ae))
                return 0;
 
@@ -5501,7 +5505,8 @@ static void bgp_aggregate_install(struct bgp *bgp, afi_t afi, safi_t safi,
                 * If the aggregate information has not changed
                 * no need to re-install it again.
                 */
-               if (bgp_aggregate_info_same(rn->info, aspath, community)) {
+               if (bgp_aggregate_info_same(rn->info, origin, aspath,
+                                           community)) {
                        bgp_unlock_node(rn);
 
                        if (aspath)