From: Guy Harris Date: Mon, 14 May 2018 10:00:20 +0000 (-0700) Subject: UN*X - the OS family with at least 4 ways of saying "no can do" for an ioctl. X-Git-Tag: libpcap-1.9-bp~30 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/5ed387fda83b80d7844ea525d5f8849ca9b0cc25?hp=--cc UN*X - the OS family with at least 4 ways of saying "no can do" for an ioctl. Here's number 4 - ENODEV, in addition to EOPNOTSUPP and EINVAL and ENOTTY. --- 5ed387fda83b80d7844ea525d5f8849ca9b0cc25 diff --git a/pcap-bpf.c b/pcap-bpf.c index 9f4c62b5..6ce383b0 100644 --- a/pcap-bpf.c +++ b/pcap-bpf.c @@ -2747,7 +2747,8 @@ get_if_flags(const char *name, bpf_u_int32 *flags, char *errbuf) memset(&req, 0, sizeof(req)); strncpy(req.ifm_name, name, sizeof(req.ifm_name)); if (ioctl(sock, SIOCGIFMEDIA, &req) < 0) { - if (errno == EOPNOTSUPP || errno == EINVAL || errno == ENOTTY) { + if (errno == EOPNOTSUPP || errno == EINVAL || errno == ENOTTY || + errno == ENODEV) { /* * Not supported, so we can't provide any * additional information. Assume that