]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: set evpn rvtep nexthops as active by default
authorMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>
Fri, 13 Oct 2017 22:48:01 +0000 (15:48 -0700)
committerMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>
Thu, 14 Dec 2017 18:57:05 +0000 (10:57 -0800)
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
lib/nexthop.h
zebra/zebra_rib.c
zebra/zserv.c

index 20b0cd522773b96760b980c75fb0ceb9794d1476..a727f37057f3c9413f366f848671c4b8a5944c20 100644 (file)
@@ -80,6 +80,7 @@ struct nexthop {
 #define NEXTHOP_FLAG_MATCHED    (1 << 4) /* Already matched vs a nexthop */
 #define NEXTHOP_FLAG_FILTERED   (1 << 5) /* rmap filtered, used by static only */
 #define NEXTHOP_FLAG_DUPLICATE  (1 << 6) /* nexthop duplicates another active one */
+#define NEXTHOP_FLAG_EVPN_RVTEP (1 << 7) /* EVPN remote vtep nexthop */
 #define NEXTHOP_IS_ACTIVE(flags) \
        (CHECK_FLAG(flags, NEXTHOP_FLAG_ACTIVE) \
                && !CHECK_FLAG(flags, NEXTHOP_FLAG_DUPLICATE))
index 82f087cebf0b3e76f09d34d11b9d8891a204a98d..ed1a4953bf292bfe011e244df338cbb223d4c7e4 100644 (file)
@@ -847,7 +847,9 @@ static unsigned nexthop_active_check(struct route_node *rn,
        case NEXTHOP_TYPE_IPV4:
        case NEXTHOP_TYPE_IPV4_IFINDEX:
                family = AFI_IP;
-               if (nexthop_active(AFI_IP, re, nexthop, set, rn))
+               if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN_RVTEP))
+                       SET_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE);
+               else if (nexthop_active(AFI_IP, re, nexthop, set, rn))
                        SET_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE);
                else
                        UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE);
index fb0412c0a37831943144c443c5b4cee41917ed2d..db0994194497a7be36348954e8335d8955e57341 100644 (file)
@@ -1183,6 +1183,8 @@ static int zread_route_add(struct zserv *client, u_short length,
                                   program the nh as neigh */
                                if (CHECK_FLAG(api.flags,
                                               ZEBRA_FLAG_EVPN_TYPE2_ROUTE)) {
+                                       SET_FLAG(nexthop->flags,
+                                                NEXTHOP_FLAG_EVPN_RVTEP);
                                        vtep_ip.ipa_type = IPADDR_V4;
                                        memcpy(&(vtep_ip.ipaddr_v4),
                                               &(api_nh->gate.ipv4),