diff options
-rw-r--r-- | sbin/dhclient/dispatch.c | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c index 3396c9e9d4c..b4cb665ea0b 100644 --- a/sbin/dhclient/dispatch.c +++ b/sbin/dhclient/dispatch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dispatch.c,v 1.95 2014/11/26 00:15:36 krw Exp $ */ +/* $OpenBSD: dispatch.c,v 1.96 2014/11/26 17:34:36 krw Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -105,21 +105,11 @@ dispatch(void) void (*func)(void); while (quit == 0) { - if (!ifi) { - warning("No interface!"); - quit = INTERNALSIG; - continue; - } if (ifi->rdomain != get_rdomain(ifi->name)) { warning("%s rdomain changed; exiting", ifi->name); quit = INTERNALSIG; continue; } - if (ifi->bfdesc == -1) { - warning("%s bpf socket gone; exiting", ifi->name); - quit = INTERNALSIG; - continue; - } if (timeout.func) { time(&cur_time); @@ -168,17 +158,12 @@ dispatch(void) } } - if ((fds[0].revents & (POLLIN | POLLHUP))) { - if (ifi && ifi->linkstat && ifi->bfdesc != -1) - packethandler(); - } - if ((fds[1].revents & (POLLIN | POLLHUP))) { - if (ifi) - routehandler(); - } - if (fds[2].revents & POLLOUT) { + if ((fds[0].revents & (POLLIN | POLLHUP))) + packethandler(); + if ((fds[1].revents & (POLLIN | POLLHUP))) + routehandler(); + if (fds[2].revents & POLLOUT) flush_unpriv_ibuf("dispatch"); - } if ((fds[2].revents & (POLLIN | POLLHUP))) { /* Pipe to [priv] closed. Assume it emitted error. */ quit = INTERNALSIG; |