]> The Tcpdump Group git mirrors - libpcap/commitdiff
UN*X - the OS family with at least 4 ways of saying "no can do" for an ioctl.
authorGuy Harris <[email protected]>
Mon, 14 May 2018 10:00:20 +0000 (03:00 -0700)
committerGuy Harris <[email protected]>
Mon, 14 May 2018 10:00:20 +0000 (03:00 -0700)
Here's number 4 - ENODEV, in addition to EOPNOTSUPP and EINVAL and
ENOTTY.

pcap-bpf.c

index 9f4c62b5845b01d059014612c0fcf5234efed86f..6ce383b0f605b9576f3fea04c5309fcbaef12961 100644 (file)
@@ -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