]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: fix advertise-svi-ip upon vni-svi up-down 5044/head
authorChirag Shah <chirag@cumulusnetworks.com>
Thu, 12 Sep 2019 00:29:04 +0000 (17:29 -0700)
committerChirag Shah <chirag@cumulusnetworks.com>
Tue, 24 Sep 2019 04:14:04 +0000 (21:14 -0700)
When a VxLAN interface comes up new vni up event is sent
to bgpd, which triggers bgpd to sync advertise-svi-macip
to zebra. At this point, vni is present but the associated
SVI may not be present.
When SVI comes up, vni add event sent to bgpd (with associated
vrf update). Bgpd already has vni present so
advertise-svi-macip is not synced to Zebra.

To fix,
When advertise-svi-macip flag is synced first time, cache it in
zebra context even though vni associated SVI is not present.
when SVI comes up, interface address add event triggers
new MAC-IP route add to bgpd.

Ticket:CM-26038
Reviewed By:CCR-9254
Testing Done:

Validated via running a sequence of steps in symmetric
routing topology.
- Enable advertise-svi-macip at l2vni level under bgp default
instance (afi/safi, l2vpn/evpn)
- Flap l2vni associated SVI interface.
- Check the output of 'show bgp l2vpn evpn route' command for
MAC-IP route of the SVI's (MAC and IP address).

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

index c7f2976acecd3f86f8239c7a252ac7c51dcd121c..2417b505adf9dd6aa5ae66f2009faaf6504fff1a 100644 (file)
@@ -9153,6 +9153,11 @@ void zebra_vxlan_advertise_svi_macip(ZAPI_HANDLER_ARGS)
                if (zvni->advertise_svi_macip == advertise)
                        return;
 
+               /* Store flag even though SVI is not present.
+                * Once SVI comes up triggers self MAC-IP route add.
+                */
+               zvni->advertise_svi_macip = advertise;
+
                ifp = zvni->vxlan_if;
                if (!ifp)
                        return;
@@ -9164,20 +9169,17 @@ void zebra_vxlan_advertise_svi_macip(ZAPI_HANDLER_ARGS)
                        return;
 
                zl2_info = zif->l2info.vxl;
-
                vlan_if = zvni_map_to_svi(zl2_info.access_vlan,
                                          zif->brslave_info.br_if);
                if (!vlan_if)
                        return;
 
                if (advertise) {
-                       zvni->advertise_svi_macip = advertise;
                        /* Add primary SVI MAC-IP */
                        zvni_add_macip_for_intf(vlan_if, zvni);
                } else {
-                       /* Del primary MAC-IP */
+                       /* Del primary SVI MAC-IP */
                        zvni_del_macip_for_intf(vlan_if, zvni);
-                       zvni->advertise_svi_macip = advertise;
                }
        }