Merge pull request #18690 from karthikeyav/multipath_num_check_nhg
Some checks failed
build-test / Build the x86 ubuntu 22.04 docker image (push) Has been cancelled
build-test / Test ubuntu x86 docker image (push) Has been cancelled
build-test / Build the ARM ubuntu 22.04 docker image (push) Has been cancelled
build-test / Test ubuntu ARM docker image (push) Has been cancelled

*: Fix MULTIPATH_NUM check in nhg encode
This commit is contained in:
Mark Stapp 2025-04-25 11:31:48 -04:00 committed by GitHub
commit 083893dfbb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View 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;