From: Mitesh Kanjariya Date: Wed, 21 Jun 2017 21:25:39 +0000 (-0700) Subject: zebra: update sticky mac attribute to BGP if necessary X-Git-Tag: frr-4.0-dev~431^2~24 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=b8ce75a5d3cca1519bf788db96379c162a3c9b7b;p=mirror%2Ffrr.git 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 --- 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