summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2020-03-11 07:01:43 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2020-03-11 07:01:43 +0000
commit196d18469fce80c5eb6d9d995224c2f9e1632b08 (patch)
tree96002caebe9cd401389f3fedef878a98ca1c9c5d /sys/net
parentba651d03fbc9e5b02e1cb703d8cbcea406cf650e (diff)
properly limit indexing into the aggr_periodic_times array.
coverity CID 1486819 pointed out by and ok tobhe@
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_aggr.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/net/if_aggr.c b/sys/net/if_aggr.c
index cc35fa8d994..10cc3c66b8d 100644
--- a/sys/net/if_aggr.c
+++ b/sys/net/if_aggr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_aggr.c,v 1.27 2019/12/23 09:03:24 dlg Exp $ */
+/* $OpenBSD: if_aggr.c,v 1.28 2020/03/11 07:01:42 dlg Exp $ */
/*
* Copyright (c) 2019 The University of Queensland
@@ -1022,8 +1022,7 @@ aggr_set_options(struct aggr_softc *sc, const struct trunk_opts *tro)
break;
case TRUNK_OPT_LACP_TIMEOUT:
- if (opt->lacp_timeout > nitems(aggr_periodic_times) ||
- aggr_periodic_times[opt->lacp_timeout] == 0)
+ if (opt->lacp_timeout >= nitems(aggr_periodic_times))
return (EINVAL);
aggr_set_lacp_timeout(sc, opt->lacp_timeout);