diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c index fcb6585b35..e64e64c974 100644 --- a/zebra/zebra_rnh.c +++ b/zebra/zebra_rnh.c @@ -101,12 +101,13 @@ struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid, rnh_type_t type, struct route_node *rn; struct rnh *rnh = NULL; char buf[PREFIX2STR_BUFFER]; + afi_t afi = family2afi(p->family); if (IS_ZEBRA_DEBUG_NHT) { prefix2str(p, buf, sizeof(buf)); zlog_debug("%u: Add RNH %s type %d", vrfid, buf, type); } - table = get_rnh_table(vrfid, family2afi(PREFIX_FAMILY(p)), type); + table = get_rnh_table(vrfid, afi, type); if (!table) { prefix2str(p, buf, sizeof(buf)); flog_warn(EC_ZEBRA_RNH_NO_TABLE, @@ -127,6 +128,7 @@ struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid, rnh_type_t type, rnh->client_list = list_new(); rnh->vrf_id = vrfid; rnh->type = type; + rnh->afi = afi; rnh->zebra_pseudowire_list = list_new(); route_lock_node(rn); rn->info = rnh; diff --git a/zebra/zebra_rnh.h b/zebra/zebra_rnh.h index 574dcb27be..38c95877ed 100644 --- a/zebra/zebra_rnh.h +++ b/zebra/zebra_rnh.h @@ -42,6 +42,8 @@ struct rnh { /* VRF identifier. */ vrf_id_t vrf_id; + afi_t afi; + rnh_type_t type; struct route_entry *state;