]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: add mac ip dad timers cleanup
authorChirag Shah <chirag@cumulusnetworks.com>
Sat, 16 Mar 2019 02:09:25 +0000 (19:09 -0700)
committerChirag Shah <chirag@cumulusnetworks.com>
Sat, 23 Mar 2019 00:12:16 +0000 (17:12 -0700)
When MAC or IP deleted ensure to cleanup DAD timers.

Signed-off-by: Chirag Shah <chirag@cumulusnetwork.com>
zebra/zebra_vxlan.c

index b44c314d5bd18911cc22bb3e25c4f51d9e1cfe91..04209ded534a453bd546318ab0f0e3f52aa12065 100644 (file)
@@ -2191,6 +2191,7 @@ static zebra_neigh_t *zvni_neigh_add(zebra_vni_t *zvni, struct ipaddr *ip,
        memcpy(&n->emac, mac, ETH_ALEN);
        n->state = ZEBRA_NEIGH_INACTIVE;
        n->zvni = zvni;
+       n->dad_ip_auto_recovery_timer = NULL;
 
        /* Associate the neigh to mac */
        zmac = zvni_mac_lookup(zvni, mac);
@@ -2212,6 +2213,9 @@ static int zvni_neigh_del(zebra_vni_t *zvni, zebra_neigh_t *n)
        if (zmac)
                listnode_delete(zmac->neigh_list, n);
 
+       /* Cancel auto recovery */
+       THREAD_OFF(n->dad_ip_auto_recovery_timer);
+
        /* Free the VNI hash entry and allocated memory. */
        tmp_n = hash_release(zvni->neigh_table, n);
        XFREE(MTYPE_NEIGH, tmp_n);
@@ -3308,6 +3312,9 @@ static zebra_mac_t *zvni_mac_add(zebra_vni_t *zvni, struct ethaddr *macaddr)
        mac = hash_get(zvni->mac_table, &tmp_mac, zvni_mac_alloc);
        assert(mac);
 
+       mac->zvni = zvni;
+       mac->dad_mac_auto_recovery_timer = NULL;
+
        mac->neigh_list = list_new();
        mac->neigh_list->cmp = neigh_list_cmp;
 
@@ -3321,6 +3328,9 @@ static int zvni_mac_del(zebra_vni_t *zvni, zebra_mac_t *mac)
 {
        zebra_mac_t *tmp_mac;
 
+       /* Cancel auto recovery */
+       THREAD_OFF(mac->dad_mac_auto_recovery_timer);
+
        list_delete(&mac->neigh_list);
 
        /* Free the VNI hash entry and allocated memory. */