summaryrefslogtreecommitdiff
path: root/zebra/zserv.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zserv.c')
-rw-r--r--zebra/zserv.c37
1 files changed, 31 insertions, 6 deletions
diff --git a/zebra/zserv.c b/zebra/zserv.c
index bca8a509d8..07258cdb72 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -1143,6 +1143,7 @@ static int zread_route_add(struct zserv *client, u_short length,
struct nexthop *nexthop = NULL;
int i, ret;
vrf_id_t vrf_id = 0;
+ struct ipaddr vtep_ip;
s = client->ibuf;
if (zapi_route_decode(s, &api) < 0)
@@ -1173,9 +1174,7 @@ static int zread_route_add(struct zserv *client, u_short length,
re, &api_nh->gate.ipv4, NULL,
api_nh->vrf_id);
break;
- case NEXTHOP_TYPE_IPV4_IFINDEX: {
-
- struct ipaddr vtep_ip;
+ case NEXTHOP_TYPE_IPV4_IFINDEX:
memset(&vtep_ip, 0, sizeof(struct ipaddr));
if (CHECK_FLAG(api.flags,
@@ -1191,7 +1190,7 @@ static int zread_route_add(struct zserv *client, u_short length,
api_nh->vrf_id);
/* if this an EVPN route entry,
- program the nh as neigh
+ * program the nh as neigh
*/
if (CHECK_FLAG(api.flags,
ZEBRA_FLAG_EVPN_ROUTE)) {
@@ -1208,15 +1207,41 @@ static int zread_route_add(struct zserv *client, u_short length,
&api.prefix);
}
break;
- }
case NEXTHOP_TYPE_IPV6:
nexthop = route_entry_nexthop_ipv6_add(
re, &api_nh->gate.ipv6, api_nh->vrf_id);
break;
case NEXTHOP_TYPE_IPV6_IFINDEX:
+ memset(&vtep_ip, 0, sizeof(struct ipaddr));
+ if (CHECK_FLAG(api.flags,
+ ZEBRA_FLAG_EVPN_ROUTE)) {
+ ifindex =
+ get_l3vni_svi_ifindex(vrf_id);
+ } else {
+ ifindex = api_nh->ifindex;
+ }
+
nexthop = route_entry_nexthop_ipv6_ifindex_add(
- re, &api_nh->gate.ipv6, api_nh->ifindex,
+ re, &api_nh->gate.ipv6, ifindex,
api_nh->vrf_id);
+
+ /* if this an EVPN route entry,
+ * program the nh as neigh
+ */
+ if (CHECK_FLAG(api.flags,
+ ZEBRA_FLAG_EVPN_ROUTE)) {
+ SET_FLAG(nexthop->flags,
+ NEXTHOP_FLAG_EVPN_RVTEP);
+ vtep_ip.ipa_type = IPADDR_V6;
+ memcpy(&vtep_ip.ipaddr_v6,
+ &(api_nh->gate.ipv6),
+ sizeof(struct in6_addr));
+ zebra_vxlan_evpn_vrf_route_add(
+ vrf_id,
+ &api.rmac,
+ &vtep_ip,
+ &api.prefix);
+ }
break;
case NEXTHOP_TYPE_BLACKHOLE:
nexthop = route_entry_nexthop_blackhole_add(