summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorgnezdo <gnezdo@cvs.openbsd.org>2021-01-09 21:00:59 +0000
committergnezdo <gnezdo@cvs.openbsd.org>2021-01-09 21:00:59 +0000
commit59eef53cd06f35df8eb494e617e53f1b3505b0e7 (patch)
treed130c4f960747f0d1d8dd55488fd4b105402533e /sys
parentf3cbcbbca73ad418b672e38aa65a3a688f5db1b4 (diff)
Enforce range with sysctl_int_bounded in etherip_sysctl
OK millert@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_etherip.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/net/if_etherip.c b/sys/net/if_etherip.c
index 15c26b63509..4a2a6592afa 100644
--- a/sys/net/if_etherip.c
+++ b/sys/net/if_etherip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_etherip.c,v 1.47 2020/08/21 22:59:27 kn Exp $ */
+/* $OpenBSD: if_etherip.c,v 1.48 2021/01/09 21:00:58 gnezdo Exp $ */
/*
* Copyright (c) 2015 Kazuya GODA <goda@openbsd.org>
*
@@ -767,7 +767,8 @@ etherip_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp,
switch (name[0]) {
case ETHERIPCTL_ALLOW:
NET_LOCK();
- error = sysctl_int(oldp, oldlenp, newp, newlen, &etherip_allow);
+ error = sysctl_int_bounded(oldp, oldlenp, newp, newlen,
+ &etherip_allow, 0, 1);
NET_UNLOCK();
return (error);
case ETHERIPCTL_STATS: