summaryrefslogtreecommitdiff
path: root/sys/net/if_gre.c
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2018-10-18 01:58:16 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2018-10-18 01:58:16 +0000
commit842e456c3ec347283a3aa02a68d198e93e2a72f3 (patch)
treea57e28d29da03660b0a7866d22a6de34e3742335 /sys/net/if_gre.c
parent9636aa4f22713f696a38e936949e6f0e00c44764 (diff)
make sure keepalive ioctl values are either both zero, or both not zero.
Diffstat (limited to 'sys/net/if_gre.c')
-rw-r--r--sys/net/if_gre.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c
index c9413bee32a..4b8d9d4dc8c 100644
--- a/sys/net/if_gre.c
+++ b/sys/net/if_gre.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_gre.c,v 1.128 2018/10/18 01:46:21 dlg Exp $ */
+/* $OpenBSD: if_gre.c,v 1.129 2018/10/18 01:58:15 dlg Exp $ */
/* $NetBSD: if_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */
/*
@@ -2163,7 +2163,8 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
case SIOCSETKALIVE:
if (ikar->ikar_timeo < 0 || ikar->ikar_timeo > 86400 ||
- ikar->ikar_cnt < 0 || ikar->ikar_cnt > 256)
+ ikar->ikar_cnt < 0 || ikar->ikar_cnt > 256 ||
+ (ikar->ikar_timeo == 0) != (ikar->ikar_cnt == 0))
return (EINVAL);
if (ikar->ikar_timeo == 0 || ikar->ikar_cnt == 0) {