From 52dc1bb9be582e810c389c23f8d8748f32039311 Mon Sep 17 00:00:00 2001 From: Karthikeya Venkat Muppalla Date: Fri, 18 Apr 2025 11:39:40 -0700 Subject: [PATCH] *: Fix MULTIPATH_NUM check in nhg encode In zapi_nhg_encode we check if number of paths are >= MULTIPATH_NUM, the condition should be just checking if it is > not >= Signed-off-by: Karthikeya Venkat Muppalla --- lib/zclient.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/zclient.c b/lib/zclient.c index 031f454385..7af86cf4d9 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -1275,8 +1275,8 @@ static int zapi_nhg_encode(struct stream *s, int cmd, struct zapi_nhg *api_nhg) return -1; } - if (api_nhg->nexthop_num >= MULTIPATH_NUM || - api_nhg->backup_nexthop_num >= MULTIPATH_NUM) { + if (api_nhg->nexthop_num > MULTIPATH_NUM || + api_nhg->backup_nexthop_num > MULTIPATH_NUM) { flog_err(EC_LIB_ZAPI_ENCODE, "%s: zapi NHG encode with invalid input", __func__); return -1; -- 2.39.5