2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-31 06:15:55 +00:00

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
This commit is contained in:
Murray
2002-06-08 09:28:15 +00:00
parent f953078e4e
commit d1d0d78ad5

View 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);