Blame bridge-utils-1.2-foreach.patch
|
David Woodhouse |
946eda |
diff --git a/libbridge/libbridge_init.c b/libbridge/libbridge_init.c
|
|
David Woodhouse |
946eda |
index a7473bd..d093bb1 100644
|
|
David Woodhouse |
946eda |
--- a/libbridge/libbridge_init.c
|
|
David Woodhouse |
946eda |
+++ b/libbridge/libbridge_init.c
|
|
David Woodhouse |
946eda |
@@ -49,6 +49,12 @@ static int isbridge(const struct dirent *entry)
|
|
David Woodhouse |
1e36be |
char path[SYSFS_PATH_MAX];
|
|
David Woodhouse |
1e36be |
struct stat st;
|
|
David Woodhouse |
1e36be |
|
|
David Woodhouse |
946eda |
+ /* Ignore "." and ".." entries. */
|
|
David Woodhouse |
946eda |
+ if (entry->d_name[0] == '.' &&
|
|
David Woodhouse |
946eda |
+ (entry->d_name[1] == 0 ||
|
|
David Woodhouse |
946eda |
+ (entry->d_name[1] == '.' && entry->d_name[2] == 0)))
|
|
David Woodhouse |
946eda |
+ return 0;
|
|
David Woodhouse |
946eda |
+
|
|
David Woodhouse |
946eda |
snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/bridge", entry->d_name);
|
|
David Woodhouse |
946eda |
return stat(path, &st) == 0 && S_ISDIR(st.st_mode);
|
|
David Woodhouse |
1e36be |
}
|