]> The Tcpdump Group git mirrors - libpcap/commitdiff
Ignore directories in /sys/class/net.
authorGuy Harris <[email protected]>
Sun, 10 Jan 2010 19:05:00 +0000 (11:05 -0800)
committerGuy Harris <[email protected]>
Sun, 10 Jan 2010 19:05:00 +0000 (11:05 -0800)
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.
                 */