From 371ac29c9f019f4163657505d499f081874f507b Mon Sep 17 00:00:00 2001 From: Philip Homburg Date: Fri, 14 Jul 2006 13:35:21 +0000 Subject: [PATCH] Clear NONBLOCK flag after probing ethernet device. --- commands/dhcpd/devices.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/commands/dhcpd/devices.c b/commands/dhcpd/devices.c index 02944fb35..3d12a1648 100755 --- a/commands/dhcpd/devices.c +++ b/commands/dhcpd/devices.c @@ -173,12 +173,14 @@ int opendev(network_t *np, fdtype_t fdtype, int compete) switch (fdtype) { case FT_ETHERNET: + /* Set NONBLOCK to avoid waiting for a device driver to become ready */ fcntl(np->fdp->fd, F_SETFL, fcntl(np->fdp->fd, F_GETFL) | O_NONBLOCK); if (ioctl(np->fdp->fd, NWIOGETHSTAT, ðstat) < 0) { /* Not an Ethernet. */ close(fdp->fd); return 0; } + fcntl(np->fdp->fd, F_SETFL, fcntl(np->fdp->fd, F_GETFL) & ~O_NONBLOCK); np->eth= ethstat.nwes_addr; ethopt.nweo_flags= NWEO_COPY | NWEO_EN_LOC | NWEO_EN_BROAD | NWEO_REMANY | NWEO_TYPEANY | NWEO_RWDATALL; -- 2.44.0