summaryrefslogtreecommitdiff
path: root/common/bpf.c
diff options
context:
space:
mode:
authorMurray <source@isc.org>2002-06-08 09:28:15 +0000
committerMurray <source@isc.org>2002-06-08 09:28:15 +0000
commitd1d0d78ad503efe7197b5a3b5b3e20cdb770470f (patch)
treeccc21abd6f079ad4a299dfe125581695c88184fd /common/bpf.c
parentf953078e4e41ab8ac090c5db7eef8c2468aad979 (diff)
downloadisc-dhcp-d1d0d78ad503efe7197b5a3b5b3e20cdb770470f.tar.gz
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
Diffstat (limited to 'common/bpf.c')
-rw-r--r--common/bpf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/common/bpf.c b/common/bpf.c
index 49af907d..86022d16 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);