diff --git a/zebra/zebra_nhg.h b/zebra/zebra_nhg.h index 58f8e18b73..ce3d2ed6c3 100644 --- a/zebra/zebra_nhg.h +++ b/zebra/zebra_nhg.h @@ -36,6 +36,21 @@ struct nhg_hash_entry { uint32_t refcnt; uint32_t dplane_ref; + + uint32_t flags; +/* + * Is this nexthop group valid, ie all nexthops are fully resolved. + * What is fully resolved? It's a nexthop that is either self contained + * and correct( ie no recursive pointer ) or a nexthop that is recursively + * resolved and correct. + */ +#define NEXTHOP_GROUP_VALID 0x1 +/* + * Has this nexthop group been installed? At this point in time, this + * means that the data-plane has been told about this nexthop group + * and it's possible usage by a route entry. + */ +#define NEXTHOP_GROUP_INSTALLED 0x2 }; void zebra_nhg_init(void); diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 13a51ca831..d9e8c6f968 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -1118,8 +1118,11 @@ static void show_nexthop_group_cmd_helper(struct vty *vty, if (nhe->vrf_id != zvrf->vrf->vrf_id) continue; - vty_out(vty, "Group: %u RefCnt: %u afi: %d\n", nhe->dplane_ref, - nhe->refcnt, nhe->afi); + vty_out(vty, + "Group: %u RefCnt: %u afi: %d Valid: %d Installed: %d\n", + nhe->dplane_ref, nhe->refcnt, nhe->afi, + nhe->flags & NEXTHOP_GROUP_VALID, + nhe->flags & NEXTHOP_GROUP_INSTALLED); for (ALL_NEXTHOPS(nhe->nhg, nhop)) { vty_out(vty, " ");