return 0;
}
+/* don't import hosts that are locally attached */
+static inline bool
+bgp_evpn_skip_vrf_import_of_local_es(const struct prefix_evpn *evp,
+ struct bgp_path_info *pi, int install)
+{
+ if ((evp->prefix.route_type == BGP_EVPN_MAC_IP_ROUTE)
+ && bgp_evpn_attr_is_local_es(pi->attr)) {
+ if (BGP_DEBUG(evpn_mh, EVPN_MH_RT)) {
+ char esi_buf[ESI_STR_LEN];
+ char prefix_buf[PREFIX_STRLEN];
+
+ zlog_debug(
+ "vrf %s of evpn prefix %s skipped, local es %s",
+ install ? "import" : "unimport",
+ prefix2str(evp, prefix_buf, sizeof(prefix_buf)),
+ esi_to_str(bgp_evpn_attr_get_esi(pi->attr),
+ esi_buf, sizeof(esi_buf)));
+ }
+ return true;
+ }
+ return false;
+}
+
/*
* Install or uninstall mac-ip routes are appropriate for this
* particular VRF.
&& pi->sub_type == BGP_ROUTE_NORMAL))
continue;
+ /* don't import hosts that are locally attached
+ */
+ if (bgp_evpn_skip_vrf_import_of_local_es(
+ evp, pi, install))
+ continue;
+
if (is_route_matching_for_vrf(bgp_vrf, pi)) {
if (bgp_evpn_route_rmac_self_check(
bgp_vrf, evp, pi))
|| is_evpn_prefix_ipaddr_v6(evp)))
return 0;
+ /* don't import hosts that are locally attached */
+ if (bgp_evpn_skip_vrf_import_of_local_es(evp, pi, install))
+ return 0;
+
for (ALL_LIST_ELEMENTS(vrfs, node, nnode, bgp_vrf)) {
int ret;