]> The Tcpdump Group git mirrors - libpcap/commitdiff
Check for both EOPNOTSUPP and EINVAL after SIOCETHTOOL ioctl.
authorGuy Harris <[email protected]>
Fri, 28 Sep 2012 02:01:16 +0000 (19:01 -0700)
committerGuy Harris <[email protected]>
Fri, 28 Sep 2012 02:02:08 +0000 (19:02 -0700)
As reported by Dmitry Kunilov, at least some drivers return EINVAL
rather than EOPNOTSUPP for the SIOCETHTOOL ioctl, so check for both of
them.

CHANGES
pcap-linux.c

diff --git a/CHANGES b/CHANGES
index 6627c4a53a8a63074b68ad5fce2375bd2e97a043..739eff08322a6e7d1f0461387dfe6086d96ee623 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -13,6 +13,9 @@ Summary for 1.3.1 libpcap release
        Catch attempts to call pcap_compile() on a non-activated pcap_t
        Fix crash on Linux with CAN-USB support without usbfs
        Fix addition of VLAN tags for Linux cooked captures
+       Check for both EOPNOTSUPP and EINVAL after SIOCETHTOOL ioctl, so
+           that the driver can report either one if it doesn't support
+           SIOCETHTOOL
 
 Friday  March 30, 2012.  [email protected]
 Summary for 1.3.0 libpcap release
index 70ad282d4571b3fdfdc5f25b8d68c1f179851cfb..f7d92c04471b401bbcbd4e712b3414663498688b 100644 (file)
@@ -4956,7 +4956,7 @@ iface_ethtool_ioctl(pcap_t *handle, int cmd, const char *cmdname)
        eval.cmd = cmd;
        ifr.ifr_data = (caddr_t)&eval;
        if (ioctl(handle->fd, SIOCETHTOOL, &ifr) == -1) {
-               if (errno == EOPNOTSUPP) {
+               if (errno == EOPNOTSUPP || errno == EINVAL) {
                        /*
                         * OK, let's just return 0, which, in our
                         * case, either means "no, what we're asking