]> git.puffer.fish Git - mirror/frr.git/commitdiff
*: Fix MULTIPATH_NUM check in nhg encode 18690/head
authorKarthikeya Venkat Muppalla <kmuppalla@nvidia.com>
Fri, 18 Apr 2025 18:39:40 +0000 (11:39 -0700)
committerKarthikeya Venkat Muppalla <kmuppalla@nvidia.com>
Mon, 21 Apr 2025 16:47:48 +0000 (09:47 -0700)
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 <kmuppalla@nvidia.com>
lib/zclient.c

index 031f4543853274ff7133275f3411897ee3165b87..7af86cf4d99a14cc7aff7b87001957383687c547 100644 (file)
@@ -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;