]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd/zebra: honor tunnel ip change in bgp regardless of vni readiness
authorMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>
Thu, 6 Jul 2017 23:33:50 +0000 (16:33 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 8 Aug 2017 14:28:54 +0000 (10:28 -0400)
Ticket: CM-17014
Review: CCR-6432
Unit-test: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
bgpd/bgp_evpn.c
bgpd/bgp_evpn_vty.c
zebra/zebra_vxlan.c

index ab3307a6a76b3aa8e4a1d3cc98ec80ec624ef4d2..110ff3a17b6f9c8c260295a1139c744f0220a969 100644 (file)
@@ -1193,6 +1193,12 @@ static int handle_tunnel_ip_change(struct bgp *bgp, struct bgpevpn *vpn,
 {
        struct prefix_evpn p;
 
+       /* If VNI is not live, we only need to update the originator ip */
+       if (!is_vni_live(vpn)) {
+               vpn->originator_ip = originator_ip;
+               return 0;
+       }
+
        /* Need to withdraw type-3 route as the originator IP is part
         * of the key.
         */
@@ -2678,14 +2684,14 @@ int bgp_evpn_local_vni_add(struct bgp *bgp, vni_t vni,
 
        /* Lookup VNI. If present and no change, exit. */
        vpn = bgp_evpn_lookup_vni(bgp, vni);
-       if (vpn && is_vni_live(vpn)) {
+       if (vpn) {
                if (IPV4_ADDR_SAME(&vpn->originator_ip, &originator_ip))
                        /* Probably some other param has changed that we don't
                         * care about. */
                        return 0;
 
                /* Local tunnel endpoint IP address has changed */
-               return handle_tunnel_ip_change(bgp, vpn, originator_ip);
+               handle_tunnel_ip_change(bgp, vpn, originator_ip);
        }
 
        /* Create or update as appropriate. */
@@ -2699,6 +2705,10 @@ int bgp_evpn_local_vni_add(struct bgp *bgp, vni_t vni,
                }
        }
 
+       /* if the VNI is live already, there is nothibng more to do */
+       if (is_vni_live(vpn))
+               return 0;
+
        /* Mark as "live" */
        SET_FLAG(vpn->flags, VNI_FLAG_LIVE);
 
index a6f5e168c95c8b48ffc83a3e8b70c57c6bf85087..8a583a74d83e255fff161aa59da68d2590cf821a 100644 (file)
@@ -195,6 +195,8 @@ static void display_vni(struct vty *vty, struct bgpevpn *vpn)
        vty_out(vty, "  RD: %s\n",
                prefix_rd2str(&vpn->prd, buf1, RD_ADDRSTRLEN));
        vty_out(vty, "  Originator IP: %s\n", inet_ntoa(vpn->originator_ip));
+       vty_out(vty, "  Advertise-gw-macip : %s\n",
+               vpn->advertise_gw_macip ? "Yes" : "No");
 
        vty_out(vty, "  Import Route Target:\n");
        for (ALL_LIST_ELEMENTS(vpn->import_rtl, node, nnode, ecom)) {
index 393ac997b329ab912bd506b60140facaa50b1ba3..52886bd7f0e2da906ac8cc54704cd6fbb8573d9a 100644 (file)
@@ -607,6 +607,8 @@ static void zvni_print(zebra_vni_t *zvni, void **ctxt)
                json_object_int_add(json, "ifindex", zvni->vxlan_if->ifindex);
                json_object_string_add(json, "vtepIp",
                                       inet_ntoa(zvni->local_vtep_ip));
+               json_object_string_add(json, "advertiseGatewayMacip",
+                                      zvni->advertise_gw_macip ? "Yes" : "No");
                json_object_int_add(json, "numMacs", num_macs);
                json_object_int_add(json, "numArpNd", num_neigh);
        }
@@ -641,6 +643,8 @@ static void zvni_print(zebra_vni_t *zvni, void **ctxt)
                        " Number of ARPs (IPv4 and IPv6, local and remote) "
                        "known for this VNI: %u\n",
                        num_neigh);
+               vty_out(vty, " Advertise-gw-macip: %s\n",
+                       zvni->advertise_gw_macip ? "Yes" : "No");
        }
 }
 
@@ -2751,8 +2755,12 @@ void zebra_vxlan_print_vnis(struct vty *vty, struct zebra_vrf *zvrf,
        }
        if (use_json) {
                json = json_object_new_object();
+               json_object_string_add(json, "advertiseGatewayMacip",
+                                      zvrf->advertise_gw_macip ? "Yes" : "No");
                json_object_int_add(json, "numVnis", num_vnis);
        } else {
+               vty_out(vty, "Advertise gateway mac-ip: %s\n",
+                       zvrf->advertise_gw_macip ? "Yes" : "No");
                vty_out(vty, "Number of VNIs: %u\n", num_vnis);
                vty_out(vty, "%-10s %-21s %-15s %-8s %-8s %-15s\n", "VNI",
                        "VxLAN IF", "VTEP IP", "# MACs", "# ARPs",