libpcap/0079-Treat-both-ENXIO-and-EIO-as-device-went-away.patch
2019-09-30 10:57:32 -04:00

30 lines
788 B
Diff

From f22bd1264917671c87bb98e9c66c5734676f3150 Mon Sep 17 00:00:00 2001
From: Guy Harris <guy@alum.mit.edu>
Date: Sun, 30 Jun 2019 15:42:53 -0700
Subject: [PATCH 79/83] Treat both ENXIO and EIO as "device went away".
ENXIO is used on FreeBSD, DragonFly BSD, and Darwin; EIO is used on
OpenBSD.
---
pcap-bpf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pcap-bpf.c b/pcap-bpf.c
index 6fe2eaf..62e2ed0 100644
--- a/pcap-bpf.c
+++ b/pcap-bpf.c
@@ -1020,7 +1020,8 @@ pcap_read_bpf(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
case EWOULDBLOCK:
return (0);
- case ENXIO:
+ case ENXIO: /* FreeBSD, DragonFly BSD, and Darwin */
+ case EIO: /* OpenBSD */
/*
* The device on which we're capturing
* went away.
--
1.8.3.1