All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] nexthop: Fix attribute checking for groups
@ 2020-05-17 17:26 David Ahern
  2020-05-17 17:43 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: David Ahern @ 2020-05-17 17:26 UTC (permalink / raw)
  To: netdev, kuba, davem; +Cc: David Ahern, ASSOGBA Emery

From: David Ahern <dsahern@gmail.com>

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>
---
 net/ipv4/nexthop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c
index fdfca534d094..2a31c4af845e 100644
--- a/net/ipv4/nexthop.c
+++ b/net/ipv4/nexthop.c
@@ -433,7 +433,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;
 
-- 
2.21.1 (Apple Git-122.3)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] nexthop: Fix attribute checking for groups
  2020-05-17 17:26 [PATCH net] nexthop: Fix attribute checking for groups David Ahern
@ 2020-05-17 17:43 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-05-17 17:43 UTC (permalink / raw)
  To: dsahern; +Cc: netdev, kuba, dsahern, assogba.emery

From: David Ahern <dsahern@kernel.org>
Date: Sun, 17 May 2020 11:26:32 -0600

> From: David Ahern <dsahern@gmail.com>
> 
> 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>

Applied and queued up for -stable, thanks David.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-17 17:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-17 17:26 [PATCH net] nexthop: Fix attribute checking for groups David Ahern
2020-05-17 17:43 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.