Detect bridge interfaces and ignore them
authorMarcel Holtmann <marcel@holtmann.org>
Tue, 26 Feb 2008 04:29:33 +0000 (05:29 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 26 Feb 2008 04:29:33 +0000 (05:29 +0100)
plugins/80203.c

index d916c97..b4d6745 100644 (file)
 #endif
 
 #include <stdio.h>
+#include <errno.h>
+#include <sys/stat.h>
 
 #include <connman/plugin.h>
 #include <connman/iface.h>
 
 static int iface_probe(struct connman_iface *iface)
 {
+       char sysfs_path[PATH_MAX];
+       struct stat st;
+
        printf("[802.03] probe interface index %d\n", iface->index);
 
+       snprintf(sysfs_path, PATH_MAX, "%s/bridge", iface->sysfs);
+
+       if (stat(sysfs_path, &st) == 0 && (st.st_mode & S_IFDIR))
+               return -ENODEV;
+
        iface->type = CONNMAN_IFACE_TYPE_80203;
 
        iface->flags = CONNMAN_IFACE_FLAG_RTNL |