}
if (found) {
- nhe = zebra_nhg_rib_find(0, &new_grp, re->vrf_id, afi);
+ nhe = zebra_nhg_rib_find(0, &new_grp, afi);
zebra_nhg_re_update_ref(re, nhe);
if (CHECK_FLAG(re->status,
ROUTE_ENTRY_LABELS_CHANGED)) {
- nhe = zebra_nhg_rib_find(0, &new_grp,
- re->vrf_id, afi);
+ nhe = zebra_nhg_rib_find(0, &new_grp, afi);
zebra_nhg_re_update_ref(re, nhe);
}
}
/* Rib-side, you get a nexthop group struct */
-struct nhg_hash_entry *zebra_nhg_rib_find(uint32_t id,
- struct nexthop_group *nhg,
- vrf_id_t rt_vrf_id, afi_t rt_afi)
+struct nhg_hash_entry *
+zebra_nhg_rib_find(uint32_t id, struct nexthop_group *nhg, afi_t rt_afi)
{
struct nhg_hash_entry *nhe = NULL;
struct nhg_hash_entry *depend = NULL;
/* Defualt the nhe to the afi and vrf of the route */
afi_t nhg_afi = rt_afi;
- vrf_id_t nhg_vrf_id = rt_vrf_id;
+ vrf_id_t nhg_vrf_id = nhg->nexthop->vrf_id;
if (!nhg) {
flog_err(EC_ZEBRA_TABLE_LOOKUP_FAILED,
/* change the afi/vrf_id since its a group */
nhg_afi = AFI_UNSPEC;
nhg_vrf_id = 0;
- } else {
- /*
- * If the vrf_id on the nexthop does not match
- * the route one, use it instead.
- */
- vrf_id_t nh_vrf_id = nhg->nexthop->vrf_id;
-
- if (nh_vrf_id && nh_vrf_id != rt_vrf_id)
- nhg_vrf_id = nh_vrf_id;
}
if (!zebra_nhg_find(&nhe, id, nhg, &nhg_depends, nhg_vrf_id, nhg_afi,
struct nhg_hash_entry *new_nhe = NULL;
// TODO: Add proto type here
- new_nhe = zebra_nhg_rib_find(0, &new_grp, re->vrf_id, rt_afi);
+ new_nhe = zebra_nhg_rib_find(0, &new_grp, rt_afi);
zebra_nhg_re_update_ref(re, new_nhe);
}
vrf_id_t vrf_id, afi_t afi);
/* Find via route creation */
-extern struct nhg_hash_entry *zebra_nhg_rib_find(uint32_t id,
- struct nexthop_group *nhg,
- vrf_id_t rt_vrf_id,
- afi_t rt_afi);
+extern struct nhg_hash_entry *
+zebra_nhg_rib_find(uint32_t id, struct nexthop_group *nhg, afi_t rt_afi);
void zebra_nhg_free_members(struct nhg_hash_entry *nhe);