aboutsummaryrefslogtreecommitdiffstats
path: root/pcap-linux.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2010-01-10 11:05:00 -0800
committerGuy Harris <guy@alum.mit.edu>2010-01-10 11:05:00 -0800
commit1715346ad031f7a1f37be5a477b681281de52fd7 (patch)
tree33cea8fe51917ec9053cf5fdabf7164b46f5b0b0 /pcap-linux.c
parenta9a939af2ad978c2d5c3726a6513d07620e0d7da (diff)
Ignore directories in /sys/class/net.
Diffstat (limited to 'pcap-linux.c')
-rw-r--r--pcap-linux.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/pcap-linux.c b/pcap-linux.c
index 9bb71d4..6df107d 100644
--- a/pcap-linux.c
+++ b/pcap-linux.c
@@ -1827,6 +1827,12 @@ scan_sys_class_net(pcap_if_t **devlistp, char *errbuf)
}
/*
+ * Ignore directories (".", "..", and any subdirectories).
+ */
+ if (ent->d_type == DT_DIR)
+ continue;
+
+ /*
* Get the interface name.
*/
p = &ent->d_name[0];