From: Vincent Bernat Date: Fri, 7 Mar 2014 09:21:15 +0000 (+0100) Subject: interfaces: convert a whitelisted interface to a physical one X-Git-Tag: 0.7.8~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c6aa43e5b86d1c0f850e9cc5c35763ed1f009ac9;p=thirdparty%2Flldpd.git interfaces: convert a whitelisted interface to a physical one The previous change didn't allow to have bonds and VLAN handled in a sensible way in case of a whitelisted interface. --- diff --git a/src/daemon/interfaces.c b/src/daemon/interfaces.c index 33638dd5..b1a44daa 100644 --- a/src/daemon/interfaces.c +++ b/src/daemon/interfaces.c @@ -173,8 +173,9 @@ interfaces_helper_whitelist(struct lldpd *cfg, iface->flags = 0; continue; case 2: - log_debug("interfaces", "whitelist %s", iface->name); - iface->whitelisted = 1; + log_debug("interfaces", "whitelist %s (consider it as a physical interface)", + iface->name); + iface->type |= IFACE_PHYSICAL_T; continue; } } @@ -492,7 +493,7 @@ interfaces_helper_physical(struct lldpd *cfg, struct lldpd_hardware *hardware; TAILQ_FOREACH(iface, interfaces, next) { - if (!(iface->type & IFACE_PHYSICAL_T) && !iface->whitelisted) continue; + if (!(iface->type & IFACE_PHYSICAL_T)) continue; if (!iface->flags) continue; log_debug("interfaces", "%s is an acceptable ethernet device", diff --git a/src/daemon/lldpd.h b/src/daemon/lldpd.h index adffaebb..fa66636a 100644 --- a/src/daemon/lldpd.h +++ b/src/daemon/lldpd.h @@ -335,7 +335,6 @@ struct interfaces_device { int mtu; /* MTU */ int type; /* Type (see IFACE_*_T) */ int vlanid; /* If a VLAN, what is the VLAN ID? */ - int whitelisted; /* If the interface has been whitelisted */ struct interfaces_device *lower; /* Lower interface (for a VLAN for example) */ struct interfaces_device *upper; /* Upper interface (for a bridge or a bond) */