Skip to content

Commit 87c7af1

Browse files
committed
[nh] rtnl_nh_set_group Handle case where size is 0 but entries is set
That is invalid input. When size is 0 it means we want to reset the group thus having an entries argument does not make sense. Signed-off-by: Christoph Paasch <[email protected]>
1 parent 92cc31a commit 87c7af1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/route/nh.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,8 @@ int rtnl_nh_set_group(struct rtnl_nh *nexthop,
430430

431431
if (size == 0) {
432432
/* size is 0, thus we want to remove the nh group */
433+
if (entries)
434+
return -NLE_INVAL;
433435

434436
rtnl_nh_grp_put(nexthop->nh_group);
435437
nexthop->nh_group = NULL;

0 commit comments

Comments
 (0)