]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: update sticky mac attribute to BGP if necessary
authorMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>
Wed, 21 Jun 2017 21:25:39 +0000 (14:25 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 8 Aug 2017 14:09:37 +0000 (10:09 -0400)
Ticket: CM-16732
Review: CCR-6368
Unit-test: Manual (logs attached to ticket)

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

index 542b66898b2fa83a27fefa36c341d6716c229a14..029aefb0f746c6e8277d51d5b009c6fa6aab38f6 100644 (file)
@@ -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