summaryrefslogtreecommitdiff
path: root/common/bpf.c
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>2001-04-05 20:47:34 +0000
committerTed Lemon <source@isc.org>2001-04-05 20:47:34 +0000
commit89000b2e131ca53173304aacf0cd190a0e50bce3 (patch)
tree2c18c71d40ade51819ceb587ae847c565c7ac1a7 /common/bpf.c
parent57710b89ae0d7fad2bc8233a0117eb5a4265018c (diff)
downloadisc-dhcp-89000b2e131ca53173304aacf0cd190a0e50bce3.tar.gz
If we get an EIO on read, the interface is gone, so delete it.
Diffstat (limited to 'common/bpf.c')
-rw-r--r--common/bpf.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/common/bpf.c b/common/bpf.c
index c7809f25..5e8214bf 100644
--- a/common/bpf.c
+++ b/common/bpf.c
@@ -47,7 +47,7 @@
#ifndef lint
static char copyright[] =
-"$Id: bpf.c,v 1.46 2001/02/26 22:21:05 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
+"$Id: bpf.c,v 1.47 2001/04/05 20:47:34 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -254,7 +254,7 @@ void if_register_receive (info)
if (v.bv_major != BPF_MAJOR_VERSION ||
v.bv_minor < BPF_MINOR_VERSION)
- log_fatal ("Kernel BPF version out of range - recompile dhcpd!");
+ log_fatal ("BPF version mismatch - recompile DHCP!");
/* Set immediate mode so that reads return as soon as a packet
comes in, rather than waiting for the input buffer to fill with
@@ -422,8 +422,14 @@ ssize_t receive_packet (interface, buf, len, from, hfrom)
length = read (interface -> rfdesc,
interface -> rbuf,
interface -> rbuf_max);
- if (length <= 0)
+ if (length <= 0) {
+ if (errno == EIO) {
+ dhcp_interface_remove
+ ((omapi_object_t *)interface,
+ (omapi_object_t *)0);
+ }
return length;
+ }
interface -> rbuf_offset = 0;
interface -> rbuf_len = BPF_WORDALIGN (length);
}