]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Add fix for multiple set commands with prefer-global
authorroot <root@dslice-debian.cumulusnetworks.com>
Tue, 30 Aug 2016 12:59:08 +0000 (08:59 -0400)
committerroot <root@dslice-debian.cumulusnetworks.com>
Tue, 30 Aug 2016 12:59:08 +0000 (08:59 -0400)
In further testing, found that if there were multiple set commands in
the route-map with one being prefer-global, the removal of the prefer-global
was not recognized and reacted to correctly.  This small addition includes
that support

Ticket: CM-11480
Signed-off-by: Don Slice
Reviewed By: Donald Sharp
Testing Done: Manual testing, bgp-min and bgp-smoke completed

bgpd/bgp_attr.h
bgpd/bgp_routemap.c

index a279674af280f97884eea2e1f7e7b342787f7063..9a8e2a75e2dc0a7b07cb80b54a3cf632975c8bac 100644 (file)
@@ -148,6 +148,7 @@ struct attr
 #define BATTR_RMAP_NEXTHOP_UNCHANGED (1 << 3)
 #define BATTR_RMAP_IPV6_GLOBAL_NHOP_CHANGED (1 << 4)
 #define BATTR_RMAP_IPV6_LL_NHOP_CHANGED (1 << 5)
+#define BATTR_RMAP_IPV6_PREFER_GLOBAL_CHANGED (1 << 6)
 
 /* Router Reflector related structure. */
 struct cluster_list
@@ -277,6 +278,7 @@ bgp_rmap_nhop_changed(u_int32_t out_rmap_flags, u_int32_t in_rmap_flags)
            CHECK_FLAG(out_rmap_flags, BATTR_RMAP_NEXTHOP_UNCHANGED) ||
            CHECK_FLAG(out_rmap_flags, BATTR_RMAP_IPV4_NHOP_CHANGED) ||
            CHECK_FLAG(out_rmap_flags, BATTR_RMAP_IPV6_GLOBAL_NHOP_CHANGED) ||
+           CHECK_FLAG(out_rmap_flags, BATTR_RMAP_IPV6_PREFER_GLOBAL_CHANGED) ||
            CHECK_FLAG(out_rmap_flags, BATTR_RMAP_IPV6_LL_NHOP_CHANGED) ||
            CHECK_FLAG(in_rmap_flags, BATTR_RMAP_NEXTHOP_UNCHANGED)) ? 1 : 0);
 }
index 2a4d41663382492b4b1d42f09f3fcacf42effbc7..e4fd730cf06965ab87911475c369b6b955bdc916 100644 (file)
@@ -2215,8 +2215,14 @@ route_set_ipv6_nexthop_prefer_global (void *rule, struct prefix *prefix,
           /* Set next hop preference to global */
           bgp_info->attr->extra->mp_nexthop_prefer_global = TRUE;
           SET_FLAG(bgp_info->attr->rmap_change_flags,
-                   BATTR_RMAP_IPV6_GLOBAL_NHOP_CHANGED);
+                   BATTR_RMAP_IPV6_PREFER_GLOBAL_CHANGED);
        }
+      else
+        {
+          bgp_info->attr->extra->mp_nexthop_prefer_global = FALSE;
+          SET_FLAG(bgp_info->attr->rmap_change_flags,
+                   BATTR_RMAP_IPV6_PREFER_GLOBAL_CHANGED);
+        }
     }
  return RMAP_OKAY;
 }