Skip to content

Commit 84be69b

Browse files
dsaherndavem330
authored andcommitted
nexthop: Fix attribute checking for groups
For nexthop groups, attributes after NHA_GROUP_TYPE are invalid, but nh_check_attr_group starts checking at NHA_GROUP. The group type defaults to multipath and the NHA_GROUP_TYPE is currently optional so this has slipped through so far. Fix the attribute checking to handle support of new group types. Fixes: 430a049 ("nexthop: Add support for nexthop groups") Signed-off-by: ASSOGBA Emery <[email protected]> Signed-off-by: David Ahern <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f45a7bc commit 84be69b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/nexthop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ static int nh_check_attr_group(struct net *net, struct nlattr *tb[],
433433
if (!valid_group_nh(nh, len, extack))
434434
return -EINVAL;
435435
}
436-
for (i = NHA_GROUP + 1; i < __NHA_MAX; ++i) {
436+
for (i = NHA_GROUP_TYPE + 1; i < __NHA_MAX; ++i) {
437437
if (!tb[i])
438438
continue;
439439

0 commit comments

Comments
 (0)