From: Karthikeya Venkat Muppalla Date: Fri, 18 Apr 2025 18:39:40 +0000 (-0700) Subject: *: Fix MULTIPATH_NUM check in nhg encode X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=refs%2Fpull%2F18690%2Fhead;p=mirror%2Ffrr.git *: 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 --- 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;