From b8ce75a5d3cca1519bf788db96379c162a3c9b7b Mon Sep 17 00:00:00 2001 From: Mitesh Kanjariya Date: Wed, 21 Jun 2017 14:25:39 -0700 Subject: [PATCH] zebra: update sticky mac attribute to BGP if necessary Ticket: CM-16732 Review: CCR-6368 Unit-test: Manual (logs attached to ticket) Signed-off-by: Mitesh Kanjariya --- zebra/zebra_vxlan.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index 542b66898b..029aefb0f7 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -2584,6 +2584,12 @@ int zebra_vxlan_local_mac_add_update(struct interface *ifp, ? 1 : 0; + /* + * return if nothing has changed. + * inform bgp if sticky flag has changed + * update locally and do not inform bgp if local + * parameters like interface has changed + */ if (mac_sticky == sticky && mac->fwd_info.local.ifindex == ifp->ifindex && mac->fwd_info.local.vid == vid) { @@ -2598,9 +2604,11 @@ int zebra_vxlan_local_mac_add_update(struct interface *ifp, ifp->name, ifp->ifindex, vid, zvni->vni); return 0; - } - - add = 0; /* This is an update of local interface. */ + } else if (mac_sticky != sticky) + add = 1; + else + add = 0; /* This is an update of local + interface. */ } else if (CHECK_FLAG(mac->flags, ZEBRA_MAC_REMOTE)) { /* * If we have already learned the MAC as a remote sticky -- 2.39.5