From 7b51157be6fb0906f6b698258e4fae975ad1230f Mon Sep 17 00:00:00 2001 From: tedu Date: Fri, 16 Oct 2015 01:55:19 +0000 Subject: [PATCH] safety check that we're dealing with the filter we expect --- usr.sbin/rebound/rebound.c | 7 +++++-- 1 file 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 * @@ -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"); } } -- 2.20.1