summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2015-10-16 01:55:19 +0000
committertedu <tedu@openbsd.org>2015-10-16 01:55:19 +0000
commit7b51157be6fb0906f6b698258e4fae975ad1230f (patch)
tree9e9ce2f0db2d1aa8d16c8cb804469a34a42b4138
parentmost things should be static (diff)
downloadwireguard-openbsd-7b51157be6fb0906f6b698258e4fae975ad1230f.tar.xz
wireguard-openbsd-7b51157be6fb0906f6b698258e4fae975ad1230f.zip
safety check that we're dealing with the filter we expect
-rw-r--r--usr.sbin/rebound/rebound.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/rebound/rebound.c b/usr.sbin/rebound/rebound.c
index 2b8664465c8..f4db60dcd2f 100644
--- a/usr.sbin/rebound/rebound.c
+++ b/usr.sbin/rebound/rebound.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rebound.c,v 1.16 2015/10/16 01:50:39 tedu Exp $ */
+/* $OpenBSD: rebound.c,v 1.17 2015/10/16 01:55:19 tedu Exp $ */
/*
* Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
*
@@ -409,7 +409,7 @@ launch(const char *confname, int ud, int ld, int kq)
kevent(kq, chlist, 1, NULL, 0, NULL);
TAILQ_INSERT_TAIL(&reqfifo, req, fifo);
}
- } else {
+ } else if (kev[i].filter == EVFILT_READ) {
/* use a tree here? */
req = TAILQ_FIRST(&reqfifo);
while (req) {
@@ -423,6 +423,9 @@ launch(const char *confname, int ud, int ld, int kq)
if (req->client == -1)
sendreply(ud, req);
freerequest(req);
+ } else {
+ logerr(LOG_DAEMON | LOG_ERR,
+ "don't know what happened");
}
}