bgpd: Use actual defines to set values

Instead of hard coding so that if something ever changes
it will break.  Let's use the #defines that FRR has
included for us.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2023-02-18 07:24:12 -05:00
parent 5ef2911d23
commit 1aa8aef34b

View File

@ -3024,11 +3024,11 @@ static void *route_set_origin_compile(const char *arg)
origin = XMALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(uint8_t)); origin = XMALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(uint8_t));
if (strcmp(arg, "igp") == 0) if (strcmp(arg, "igp") == 0)
*origin = 0; *origin = BGP_ORIGIN_IGP;
else if (strcmp(arg, "egp") == 0) else if (strcmp(arg, "egp") == 0)
*origin = 1; *origin = BGP_ORIGIN_EGP;
else else
*origin = 2; *origin = BGP_ORIGIN_INCOMPLETE;
return origin; return origin;
} }