summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2015-02-05 09:42:53 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2015-02-05 09:42:53 +0000
commit8fd5f42a0acc50a9f3e027ff36ca2757c7e186aa (patch)
tree726117f93588a75ef92876d8a69b34f0a14ef6ea
parent22b187f176749f46aa2273b30d4008901a6a2e26 (diff)
The pf table process should die if the pipe to the dhcpd process is
closed. e.g. dhcpd has been killed. ok henning@
-rw-r--r--usr.sbin/dhcpd/pfutils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/dhcpd/pfutils.c b/usr.sbin/dhcpd/pfutils.c
index 8e385ab5b87..7f11185744a 100644
--- a/usr.sbin/dhcpd/pfutils.c
+++ b/usr.sbin/dhcpd/pfutils.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfutils.c,v 1.12 2015/01/21 21:50:33 deraadt Exp $ */
+/* $OpenBSD: pfutils.c,v 1.13 2015/02/05 09:42:52 krw Exp $ */
/*
* Copyright (c) 2006 Chris Kuethe <ckuethe@openbsd.org>
*
@@ -73,6 +73,9 @@ pftable_handler()
if (errno != EINTR)
error("poll: %m");
+ if (nfds > 0 && (pfd[0].revents & POLLHUP))
+ error("pf pipe closed");
+
if (nfds > 0 && (pfd[0].revents & POLLIN)) {
bzero(&cmd, l);
r = atomicio(read, pfpipe[0], &cmd, l);