]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: re-add remote RMAC if needed
authorMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>
Wed, 29 Nov 2017 10:25:35 +0000 (02:25 -0800)
committermitesh <mitesh@cumulusnetworks.com>
Wed, 24 Jan 2018 00:23:31 +0000 (16:23 -0800)
Kernel can delete a frr installed remote RMAC on a L3-VNI.
We should re-add if such a siatuation occurs
as we are the owner of the RMAC.
This behavor is same for remote MACs as well and was missing for RMACs.

Ticket: CM-18762
Review: CCR-6992
Testing: Manual

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

index 47aa883d11b5884f7900aa10f3841431ed737b9d..3812a64f16daf03366f9cadb35d7e5252986cb75 100644 (file)
@@ -3820,6 +3820,26 @@ static int ip_prefix_send_to_client(vrf_id_t vrf_id,
        return zebra_server_send_message(client);
 }
 
+/* re-add remote rmac if needed */
+static int zebra_vxlan_readd_remote_rmac(zebra_l3vni_t *zl3vni,
+                                 struct ethaddr *rmac)
+{
+       char buf[ETHER_ADDR_STRLEN];
+       zebra_mac_t *zrmac = NULL;
+
+       zrmac = zl3vni_rmac_lookup(zl3vni, rmac);
+       if (!zrmac)
+               return 0;
+
+       if (IS_ZEBRA_DEBUG_VXLAN)
+               zlog_debug("Del remote RMAC %s L3VNI %u - readd",
+                          prefix_mac2str(rmac, buf, sizeof(buf)),
+                          zl3vni->vni);
+
+       zl3vni_rmac_install(zl3vni, zrmac);
+       return 0;
+}
+
 /* Public functions */
 
 /* handle evpn route in vrf table */
@@ -5385,11 +5405,12 @@ int zebra_vxlan_check_readd_remote_mac(struct interface *ifp,
                                       struct interface *br_if,
                                       struct ethaddr *macaddr, vlanid_t vid)
 {
-       struct zebra_if *zif;
-       struct zebra_l2info_vxlan *vxl;
+       struct zebra_if *zif = NULL;
+       struct zebra_l2info_vxlan *vxl = NULL;
        vni_t vni;
-       zebra_vni_t *zvni;
-       zebra_mac_t *mac;
+       zebra_vni_t *zvni = NULL;
+       zebra_l3vni_t *zl3vni = NULL;
+       zebra_mac_t *mac = NULL;
        char buf[ETHER_ADDR_STRLEN];
 
        zif = ifp->info;
@@ -5401,6 +5422,11 @@ int zebra_vxlan_check_readd_remote_mac(struct interface *ifp,
        if (!is_evpn_enabled())
                return 0;
 
+       /* check if this is a remote RMAC and readd simillar to remote macs */
+       zl3vni = zl3vni_lookup(vni);
+       if (zl3vni)
+               return zebra_vxlan_readd_remote_rmac(zl3vni, macaddr);
+
        /* Locate hash entry; it is expected to exist. */
        zvni = zvni_lookup(vni);
        if (!zvni)