From d419965766b463b89eb480616a99633e7f438e42 Mon Sep 17 00:00:00 2001 From: Chirag Shah Date: Fri, 14 Dec 2018 18:34:06 -0800 Subject: [PATCH] zebra: dup addr detect fix clear mac command For neigh check duplicate flag as it can be inherited from duplicate detected MAC (count could be 0). Ticket:CM-23316 Signed-off-by: Chirag Shah --- zebra/zebra_vxlan.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index 9e9e4bac9a..b55ca60c00 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -6381,7 +6381,8 @@ int zebra_vxlan_clear_dup_detect_vni_mac(struct vty *vty, * to BGP. Similarly remote macip update, neigh needs to be * installed locally. */ - if (nbr->dad_count) { + if (zvrf->dad_freeze && + CHECK_FLAG(nbr->flags, ZEBRA_NEIGH_DUPLICATE)) { if (CHECK_FLAG(nbr->flags, ZEBRA_NEIGH_LOCAL)) ZEBRA_NEIGH_SET_INACTIVE(nbr); else if (CHECK_FLAG(nbr->flags, ZEBRA_NEIGH_REMOTE)) @@ -6401,6 +6402,10 @@ int zebra_vxlan_clear_dup_detect_vni_mac(struct vty *vty, mac->dad_dup_detect_time = 0; THREAD_OFF(mac->dad_mac_auto_recovery_timer); + /* warn-only action return */ + if (!zvrf->dad_freeze) + return CMD_SUCCESS; + /* Local: Notify Peer VTEPs, Remote: Install the entry */ if (CHECK_FLAG(mac->flags, ZEBRA_MAC_LOCAL)) { /* Inform to BGP */ -- 2.39.5