]> The Tcpdump Group git mirrors - libpcap/commitdiff
Ignore /sys/net/dev files if we get ENODEV for them, not just ENXIO.
authorandy-1 <[email protected]>
Wed, 28 Apr 2010 06:33:23 +0000 (23:33 -0700)
committerGuy Harris <[email protected]>
Wed, 28 Apr 2010 06:33:23 +0000 (23:33 -0700)
Both of them are indications that there's no such interface, so the file
probably corresponds to something other than a device.

Reviewed-By: Guy Harris <[email protected]>
CREDITS
pcap-linux.c

diff --git a/CREDITS b/CREDITS
index 0d237833b515ec401ab3648b07f6e7dff45e5388..6efc18885cc0f62af114e7207603dfa098abac02 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -15,6 +15,7 @@ Additional people who have contributed patches:
        Alexey Kuznetsov                <kuznet at ms2 dot inr dot ac dot ru>
        Alon Bar-Lev                    <alonbl at sourceforge dot net>
        Andrew Brown                    <atatat at atatdot dot net>
        Alexey Kuznetsov                <kuznet at ms2 dot inr dot ac dot ru>
        Alon Bar-Lev                    <alonbl at sourceforge dot net>
        Andrew Brown                    <atatat at atatdot dot net>
+                                       <andy-1 at sourceforge dot net>
        Antti Kantee                    <pooka at netbsd dot org>
        Arien Vijn                      <arienvijn at sourceforge dot net>
        Arkadiusz Miskiewicz            <misiek at pld dot org dot pl>
        Antti Kantee                    <pooka at netbsd dot org>
        Arien Vijn                      <arienvijn at sourceforge dot net>
        Arkadiusz Miskiewicz            <misiek at pld dot org dot pl>
index af125433f0743328fd468b9a8b6b9ac9bd7f57a2..de3239aaba9a6415ccd50f125859d6c226866d9f 100644 (file)
@@ -1883,7 +1883,7 @@ scan_sys_class_net(pcap_if_t **devlistp, char *errbuf)
                 */
                strncpy(ifrflags.ifr_name, name, sizeof(ifrflags.ifr_name));
                if (ioctl(fd, SIOCGIFFLAGS, (char *)&ifrflags) < 0) {
                 */
                strncpy(ifrflags.ifr_name, name, sizeof(ifrflags.ifr_name));
                if (ioctl(fd, SIOCGIFFLAGS, (char *)&ifrflags) < 0) {
-                       if (errno == ENXIO)
+                       if (errno == ENXIO || errno == ENODEV)
                                continue;
                        (void)snprintf(errbuf, PCAP_ERRBUF_SIZE,
                            "SIOCGIFFLAGS: %.*s: %s",
                                continue;
                        (void)snprintf(errbuf, PCAP_ERRBUF_SIZE,
                            "SIOCGIFFLAGS: %.*s: %s",