]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
If we get an EIO on read, the interface is gone, so delete it.
authorTed Lemon <source@isc.org>
Thu, 5 Apr 2001 20:47:34 +0000 (20:47 +0000)
committerTed Lemon <source@isc.org>
Thu, 5 Apr 2001 20:47:34 +0000 (20:47 +0000)
common/bpf.c

index c7809f250e3c62e1b0b985af603d9d1ff9649649..5e8214bf6964845985325906dc060234310aa852 100644 (file)
@@ -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);
                }