From cc160b8878585f2695c69e6df2db121c223f2d0f Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Wed, 19 Feb 2014 15:50:41 +0100 Subject: [PATCH] interfaces: reset router and wlan capability bits When adding capability for new interfaces, reset them if the interfaces providing the capability are not present anymore. Also, add stationOnly capability if no capability is currently present. --- src/daemon/interfaces.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/daemon/interfaces.c b/src/daemon/interfaces.c index 1a39e18d..86430e43 100644 --- a/src/daemon/interfaces.c +++ b/src/daemon/interfaces.c @@ -321,12 +321,15 @@ interfaces_helper_chassis(struct lldpd *cfg, struct lldpd_hardware *hardware; char *name = NULL; + LOCAL_CHASSIS(cfg)->c_cap_enabled &= ~(LLDP_CAP_BRIDGE | LLDP_CAP_WLAN); TAILQ_FOREACH(iface, interfaces, next) { if (iface->type & IFACE_BRIDGE_T) LOCAL_CHASSIS(cfg)->c_cap_enabled |= LLDP_CAP_BRIDGE; if (iface->type & IFACE_WIRELESS_T) LOCAL_CHASSIS(cfg)->c_cap_enabled |= LLDP_CAP_WLAN; } + if (LOCAL_CHASSIS(cfg)->c_cap_enabled == 0) + LOCAL_CHASSIS(cfg)->c_cap_enabled = LLDP_CAP_STATION; if (LOCAL_CHASSIS(cfg)->c_id != NULL && LOCAL_CHASSIS(cfg)->c_id_subtype == LLDP_CHASSISID_SUBTYPE_LLADDR) -- 2.39.5