From 1715346ad031f7a1f37be5a477b681281de52fd7 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 10 Jan 2010 11:05:00 -0800 Subject: Ignore directories in /sys/class/net. --- pcap-linux.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pcap-linux.c') diff --git a/pcap-linux.c b/pcap-linux.c index 9bb71d4..6df107d 100644 --- a/pcap-linux.c +++ b/pcap-linux.c @@ -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. */ -- cgit v1.2.3