Skip to content

Commit 52dc1bb

Browse files
author
Karthikeya Venkat Muppalla
committed
*: 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 <[email protected]>
1 parent 5d4c7d2 commit 52dc1bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/zclient.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,8 +1275,8 @@ static int zapi_nhg_encode(struct stream *s, int cmd, struct zapi_nhg *api_nhg)
12751275
return -1;
12761276
}
12771277

1278-
if (api_nhg->nexthop_num >= MULTIPATH_NUM ||
1279-
api_nhg->backup_nexthop_num >= MULTIPATH_NUM) {
1278+
if (api_nhg->nexthop_num > MULTIPATH_NUM ||
1279+
api_nhg->backup_nexthop_num > MULTIPATH_NUM) {
12801280
flog_err(EC_LIB_ZAPI_ENCODE,
12811281
"%s: zapi NHG encode with invalid input", __func__);
12821282
return -1;

0 commit comments

Comments
 (0)