]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
When an interface goes away in FreeBSD, read(2) returns ENXIO, not
authorMurray <source@isc.org>
Sat, 8 Jun 2002 09:28:15 +0000 (09:28 +0000)
committerMurray <source@isc.org>
Sat, 8 Jun 2002 09:28:15 +0000 (09:28 +0000)
EIO.

This fixes an annoying infinite-loop bug on FreeBSD.

Fix suggested by: mellon

common/bpf.c

index 49af907dcadb17c2430a226a82ddc1682b10fd99..86022d16b649733030273e226a6555e189febfb1 100644 (file)
@@ -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);