From c6aa43e5b86d1c0f850e9cc5c35763ed1f009ac9 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Fri, 7 Mar 2014 10:21:15 +0100 Subject: [PATCH] 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. --- src/daemon/interfaces.c | 7 ++++--- src/daemon/lldpd.h | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) 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) */ -- 2.39.5