if ((ipa_is_ip4(*nh) != bgp_channel_is_ipv4(c)) && !c->ext_next_hop)
return 0;
+ /* Do not pass NEXT_HOP between different VRFs */
+ if (p->p.vrf_set && s->src && s->src->p.vrf_set && (p->p.vrf != s->src->p.vrf))
+ return 0;
+
/* Keep it when exported to internal peers */
if (p->is_interior && ipa_nonzero(*nh))
return 1;
if ((ipa_is_ip4(ra->nh.gw) != bgp_channel_is_ipv4(c)) && !c->ext_next_hop)
return 0;
+ /* Do not use gateway from different VRF */
+ if (p->p.vrf_set && ra->nh.iface && (p->p.vrf != ra->nh.iface->master))
+ return 0;
+
/* Use it when exported to internal peers */
if (p->is_interior)
return 1;
uint lnum = ra->nh.labels ? ra->nh.labels : 1;
bgp_set_attr_data(to, s->pool, BA_MPLS_LABEL_STACK, 0, labels, lnum * 4);
}
+ else
+ bgp_unset_attr(to, s->pool, BA_MPLS_LABEL_STACK);
}
else
{
u32 implicit_null = BGP_MPLS_NULL;
bgp_set_attr_data(to, s->pool, BA_MPLS_LABEL_STACK, 0, &implicit_null, 4);
}
+ else
+ bgp_unset_attr(to, s->pool, BA_MPLS_LABEL_STACK);
}
}