]> The Tcpdump Group git mirrors - libpcap/blobdiff - pcap-linux.c
Ignore directories in /sys/class/net.
[libpcap] / pcap-linux.c
index 9bb71d45891957a4ce66a658db9e0e0a5063b5d2..6df107dda28225c91f5c403c78e51ee7a2301361 100644 (file)
@@ -1826,6 +1826,12 @@ scan_sys_class_net(pcap_if_t **devlistp, char *errbuf)
                        break;
                }
 
+               /*
+                * Ignore directories (".", "..", and any subdirectories).
+                */
+               if (ent->d_type == DT_DIR)
+                       continue;
+
                /*
                 * Get the interface name.
                 */