diff options
author | Ameya Dharkar <adharkar@vmware.com> | 2021-01-11 09:14:05 +0100 |
---|---|---|
committer | Ameya Dharkar <adharkar@vmware.com> | 2021-06-08 02:58:23 +0200 |
commit | 9daa5d471aeb1a6a89f3fa942c4ed6bea963358d (patch) | |
tree | f97fd550b4b27a4369bf9e2cd3e6c210f7633542 /bgpd/bgp_zebra.c | |
parent | bgpd: Import received EVPN RT-5 prefix with gateway IP in BGP VRF (diff) | |
download | frr-9daa5d471aeb1a6a89f3fa942c4ed6bea963358d.tar.xz frr-9daa5d471aeb1a6a89f3fa942c4ed6bea963358d.zip |
bgpd, zebra: Add svi_interface to zebra VNI and bgp EVPN structures
SVI ifindex for L2VNI is required in BGP to perform EVPN type-5 to type-2
recusrsive resolution using gateway IP overlay index.
Program this svi_ifindex in struct zebra_vni_t as well as in struct bgpevpn
Changes include:
1. Add svi_if field to struct zebra_evpn_t
2. Add svi_ifindex field to struct bgpevpn
3. When SVI (bridge or VLAN) is bound to a VxLAN interface, store it in the
zebra_evpn_t structure.
4. Add this SVI ifindex to ZEBRA_VNI_ADD
5. Store svi_ifindex in struct bgpevpn
Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
Diffstat (limited to 'bgpd/bgp_zebra.c')
-rw-r--r-- | bgpd/bgp_zebra.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index b32f31965..73ce2d9ae 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -2830,6 +2830,7 @@ static int bgp_zebra_process_local_vni(ZAPI_CALLBACK_ARGS) struct in_addr vtep_ip = {INADDR_ANY}; vrf_id_t tenant_vrf_id = VRF_DEFAULT; struct in_addr mcast_grp = {INADDR_ANY}; + ifindex_t svi_ifindex = 0; s = zclient->ibuf; vni = stream_getl(s); @@ -2837,6 +2838,7 @@ static int bgp_zebra_process_local_vni(ZAPI_CALLBACK_ARGS) vtep_ip.s_addr = stream_get_ipv4(s); stream_get(&tenant_vrf_id, s, sizeof(vrf_id_t)); mcast_grp.s_addr = stream_get_ipv4(s); + stream_get(&svi_ifindex, s, sizeof(ifindex_t)); } bgp = bgp_lookup_by_vrf_id(vrf_id); @@ -2844,16 +2846,17 @@ static int bgp_zebra_process_local_vni(ZAPI_CALLBACK_ARGS) return 0; if (BGP_DEBUG(zebra, ZEBRA)) - zlog_debug("Rx VNI %s VRF %s VNI %u tenant-vrf %s", - (cmd == ZEBRA_VNI_ADD) ? "add" : "del", - vrf_id_to_name(vrf_id), vni, - vrf_id_to_name(tenant_vrf_id)); + zlog_debug( + "Rx VNI %s VRF %s VNI %u tenant-vrf %s SVI ifindex %u", + (cmd == ZEBRA_VNI_ADD) ? "add" : "del", + vrf_id_to_name(vrf_id), vni, + vrf_id_to_name(tenant_vrf_id), svi_ifindex); if (cmd == ZEBRA_VNI_ADD) return bgp_evpn_local_vni_add( bgp, vni, vtep_ip.s_addr != INADDR_ANY ? vtep_ip : bgp->router_id, - tenant_vrf_id, mcast_grp); + tenant_vrf_id, mcast_grp, svi_ifindex); else return bgp_evpn_local_vni_del(bgp, vni); } |