From 54c89c9377685e32010ab1f788b2a19c0bc3531b Mon Sep 17 00:00:00 2001 From: Stephen Worley Date: Wed, 13 May 2020 14:32:13 -0400 Subject: zebra: NHG ID bounds macros Determine the NHG ID spacing and lower bound with ZEBRA_ROUTE_MAX in macros. Directly set the upperbound to be the lower 28bits of the uint32_t ID space (the top 4 are reserved for l2-NHGs). Round that number down a bit to make it more even. Convert all former lower_bound calls to just use the macro. Signed-off-by: Stephen Worley --- lib/zclient.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'lib/zclient.c') diff --git a/lib/zclient.c b/lib/zclient.c index deb5f519bd..b73dc688fb 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -4081,13 +4081,5 @@ uint32_t zclient_get_nhg_start(uint32_t proto) { assert(proto < ZEBRA_ROUTE_MAX); - return ZEBRA_NHG_SPACING * proto; -} - -/* - * Where do routing protocols IDs start overall (first ID after zebra) - */ -uint32_t zclient_get_nhg_lower_bound() -{ - return ZEBRA_NHG_SPACING * (ZEBRA_ROUTE_CONNECT + 1); + return ZEBRA_NHG_PROTO_SPACING * proto; } -- cgit v1.2.3