From 87554d831f82d2baa73c2d7146ef79f691135645 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 6 Feb 2019 10:53:48 -0500 Subject: [PATCH] zebra: Add the afi_t to the rnh Store the associated afi with the rnh, it will be useful in the future. Signed-off-by: Donald Sharp --- zebra/zebra_rnh.c | 4 +++- zebra/zebra_rnh.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) 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; -- 2.39.5