From: Guy Harris Date: Tue, 1 May 2018 07:09:22 +0000 (-0700) Subject: Or maybe you'll get ENOTTY for an invalid ioctl. X-Git-Tag: libpcap-1.9-bp~62 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/d73a7d5fe06fb603176d7e3da85aa9b03d7d8c8b Or maybe you'll get ENOTTY for an invalid ioctl. *BSD: a family of OSes divided by a common API. --- diff --git a/pcap-bpf.c b/pcap-bpf.c index 65dc9ed2..c160e5c0 100644 --- a/pcap-bpf.c +++ b/pcap-bpf.c @@ -2747,7 +2747,7 @@ 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) { + if (errno == EOPNOTSUPP || errno == EINVAL || errno == ENOTTY) { /* * Not supported, so we can't provide any * additional information. Assume that