diff options
author | David Ahern <dsahern@gmail.com> | 2020-05-17 11:26:32 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-06-03 08:21:01 +0200 |
commit | 983fa2e7740f3f2ac1d81c608eefd4e1e3d09c6d (patch) | |
tree | 324a55c33bd30e59b0e79c6a14ec3360a8333a9a /net/ipv4 | |
parent | cf4cc95a15f599560c7abd89095a7973a4b9cec3 (diff) |
nexthop: Fix attribute checking for groups
[ Upstream commit 84be69b869a5a496a6cfde9b3c29509207a1f1fa ]
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: 430a049190de ("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>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/nexthop.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c index d2369297910b..4d1531c4780c 100644 --- a/net/ipv4/nexthop.c +++ b/net/ipv4/nexthop.c @@ -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; |