Commit 84be69b8 authored by David Ahern's avatar David Ahern Committed by David S. Miller

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: 430a0491 ("nexthop: Add support for nexthop groups")
Signed-off-by: default avatarASSOGBA Emery <assogba.emery@gmail.com>
Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f45a7bcc
...@@ -433,7 +433,7 @@ static int nh_check_attr_group(struct net *net, struct nlattr *tb[], ...@@ -433,7 +433,7 @@ static int nh_check_attr_group(struct net *net, struct nlattr *tb[],
if (!valid_group_nh(nh, len, extack)) if (!valid_group_nh(nh, len, extack))
return -EINVAL; return -EINVAL;
} }
for (i = NHA_GROUP + 1; i < __NHA_MAX; ++i) { for (i = NHA_GROUP_TYPE + 1; i < __NHA_MAX; ++i) {
if (!tb[i]) if (!tb[i])
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment