From: Murray Date: Sat, 8 Jun 2002 09:28:15 +0000 (+0000) Subject: When an interface goes away in FreeBSD, read(2) returns ENXIO, not X-Git-Tag: HEAD-MERGE-V3-0-3B1~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d1d0d78ad503efe7197b5a3b5b3e20cdb770470f;p=thirdparty%2Fdhcp.git When an interface goes away in FreeBSD, read(2) returns ENXIO, not EIO. This fixes an annoying infinite-loop bug on FreeBSD. Fix suggested by: mellon --- diff --git a/common/bpf.c b/common/bpf.c index 49af907dc..86022d16b 100644 --- a/common/bpf.c +++ b/common/bpf.c @@ -47,7 +47,7 @@ #ifndef lint static char copyright[] = -"$Id: bpf.c,v 1.48 2001/04/08 21:12:49 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: bpf.c,v 1.49 2002/06/08 09:28:15 murray Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -423,7 +423,11 @@ ssize_t receive_packet (interface, buf, len, from, hfrom) interface -> rbuf, interface -> rbuf_max); if (length <= 0) { +#ifdef __FreeBSD__ + if (errno == ENXIO) { +#else if (errno == EIO) { +#endif dhcp_interface_remove ((omapi_object_t *)interface, (omapi_object_t *)0);