*/
if (old_select && old_select == new_select
&& old_select->type == ZEBRA_ROUTE_BGP
- && old_select->sub_type == BGP_ROUTE_NORMAL
+ && old_select->sub_type == BGP_ROUTE_IMPORTED
&& !CHECK_FLAG(rn->flags, BGP_NODE_USER_CLEAR)
&& !CHECK_FLAG(old_select->flags, BGP_INFO_ATTR_CHANGED)
&& !bgp->addpath_tx_used[afi][safi]) {
}
if (new_select && new_select->type == ZEBRA_ROUTE_BGP
- && new_select->sub_type == BGP_ROUTE_NORMAL) {
+ && new_select->sub_type == BGP_ROUTE_IMPORTED) {
flags = 0;
if (new_select->attr->sticky)
SET_FLAG(flags, ZEBRA_MACIP_TYPE_STICKY);
evpn_delete_old_local_route(bgp, vpn, rn, old_select);
} else {
if (old_select && old_select->type == ZEBRA_ROUTE_BGP
- && old_select->sub_type == BGP_ROUTE_NORMAL)
+ && old_select->sub_type == BGP_ROUTE_IMPORTED)
ret = evpn_zebra_uninstall(bgp, vpn,
(struct prefix_evpn *)&rn->p,
old_select->attr->nexthop);
local_ri = tmp_ri;
if (vni_table) {
if (tmp_ri->type == ZEBRA_ROUTE_BGP
- && tmp_ri->sub_type == BGP_ROUTE_NORMAL
+ && tmp_ri->sub_type == BGP_ROUTE_IMPORTED
&& CHECK_FLAG(tmp_ri->flags, BGP_INFO_VALID)) {
if (!remote_ri)
remote_ri = tmp_ri;
attr_new = bgp_attr_intern(&attr);
/* Create new route with its attribute. */
- ri = info_make(parent_ri->type, parent_ri->sub_type, 0,
+ ri = info_make(parent_ri->type, BGP_ROUTE_IMPORTED, 0,
parent_ri->peer, attr_new, rn);
SET_FLAG(ri->flags, BGP_INFO_VALID);
bgp_info_extra_get(ri);
attr_new = bgp_attr_intern(parent_ri->attr);
/* Create new route with its attribute. */
- ri = info_make(parent_ri->type, parent_ri->sub_type, 0,
+ ri = info_make(parent_ri->type, BGP_ROUTE_IMPORTED, 0,
parent_ri->peer, attr_new, rn);
SET_FLAG(ri->flags, BGP_INFO_VALID);
bgp_info_extra_get(ri);
* - BGP_ROUTE_AGGREGATE
* - BGP_ROUTE_REDISTRIBUTE
*/
- if (!(new->sub_type == BGP_ROUTE_NORMAL)) {
+ if (!(new->sub_type == BGP_ROUTE_NORMAL ||
+ new->sub_type == BGP_ROUTE_IMPORTED)) {
if (debug)
zlog_debug(
"%s: %s wins over %s due to preferred BGP_ROUTE type",
return 1;
}
- if (!(exist->sub_type == BGP_ROUTE_NORMAL)) {
+ if (!(exist->sub_type == BGP_ROUTE_NORMAL ||
+ new->sub_type == BGP_ROUTE_IMPORTED)) {
if (debug)
zlog_debug(
"%s: %s loses to %s due to preferred BGP_ROUTE type",
* Currently presence of rmac in attr denotes
* this is an EVPN type-2 route
*/
- if (!is_zero_mac(&(info->attr->rmac)))
+ if (info->sub_type == BGP_ROUTE_IMPORTED)
SET_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE);
if (peer->sort == BGP_PEER_IBGP || peer->sort == BGP_PEER_CONFED
* Currently presence of rmac in attr denotes
* this is an EVPN type-2 route
*/
- if (!is_zero_mac(&(info->attr->rmac)))
+ if (info->sub_type == BGP_ROUTE_IMPORTED)
SET_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE);
if (peer->sort == BGP_PEER_IBGP) {