Download raw body.
diff: dhcpd -u only configuration
Hello,
I'd like to fix an issue that prevents dhcpd(8) from running with a
UDP-only listening configuration.
ok?
Index: usr.sbin/dhcpd/dispatch.c
===================================================================
RCS file: /cvs/src/usr.sbin/dhcpd/dispatch.c,v
diff -u -p -r1.52 dispatch.c
--- usr.sbin/dhcpd/dispatch.c 18 Dec 2025 03:16:10 -0000 1.52
+++ usr.sbin/dhcpd/dispatch.c 5 Nov 2026 05:40:31 -0000
@@ -307,7 +307,7 @@ dispatch(void)
static struct pollfd *fds;
static int nfds_max;
time_t howlong;
- int nifaces;
+ int npolls;
for (nfds = 0, l = protocols; l; l = l->next)
nfds++;
@@ -349,23 +349,22 @@ another:
to_msec = -1;
/* Set up the descriptors to be polled. */
- nifaces = 0;
+ npolls = 0;
for (i = 0, l = protocols; l; l = l->next) {
if (l->handler == got_one) {
struct interface_info *ip = l->local;
if (ip->dead) {
l->pfd = -1;
continue;
- } else
- nifaces++;
+ }
}
-
fds[i].fd = l->fd;
fds[i].events = POLLIN;
l->pfd = i++;
+ npolls++;
}
- if (nifaces == 0)
+ if (npolls == 0)
fatalx("No live interfaces to poll on - exiting.");
/* Wait for a packet or a timeout... */
diff: dhcpd -u only configuration