From: Vincent Bernat Date: Thu, 9 Jul 2009 19:32:50 +0000 (+0200) Subject: When SYSFS_BRIDGE_* stuff does not exist, just use old /proc. X-Git-Tag: 0.5.0~37^2~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f4ed5af17ba19c1e4be1421eebcbdde5a4d3f7fc;p=thirdparty%2Flldpd.git When SYSFS_BRIDGE_* stuff does not exist, just use old /proc. --- diff --git a/src/interfaces.c b/src/interfaces.c index 99dc2990..a9f5cf63 100644 --- a/src/interfaces.c +++ b/src/interfaces.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #define SYSFS_PATH_MAX 256 @@ -147,6 +146,7 @@ old_iface_is_bridge(struct lldpd *cfg, const char *name) static int iface_is_bridge(struct lldpd *cfg, const char *name) { +#ifdef SYSFS_BRIDGE_FDB char path[SYSFS_PATH_MAX]; int f; @@ -158,6 +158,9 @@ iface_is_bridge(struct lldpd *cfg, const char *name) } close(f); return 1; +#else + return old_iface_is_bridge(cfg, name); +#endif } #ifdef ENABLE_DOT1 @@ -191,6 +194,7 @@ old_iface_is_bridged_to(struct lldpd *cfg, const char *slave, const char *master static int iface_is_bridged_to(struct lldpd *cfg, const char *slave, const char *master) { +#ifdef SYSFS_BRIDGE_PORT_SUBDIR char path[SYSFS_PATH_MAX]; int f; @@ -206,6 +210,9 @@ iface_is_bridged_to(struct lldpd *cfg, const char *slave, const char *master) } close(f); return 1; +#else + return old_iface_is_bridged_to(cfg, slave, master); +#endif } #endif