mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
nexthop: Fix attribute checking for groups
[ Upstream commit84be69b869] 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:430a049190("nexthop: Add support for nexthop groups") Signed-off-by: ASSOGBA Emery <assogba.emery@gmail.com> Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
cf4cc95a15
commit
983fa2e774
@@ -435,7 +435,7 @@ static int nh_check_attr_group(struct net *net, struct nlattr *tb[],
|
||||
if (!valid_group_nh(nh, len, extack))
|
||||
return -EINVAL;
|
||||
}
|
||||
for (i = NHA_GROUP + 1; i < __NHA_MAX; ++i) {
|
||||
for (i = NHA_GROUP_TYPE + 1; i < __NHA_MAX; ++i) {
|
||||
if (!tb[i])
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user