From: Vincent Bernat Date: Wed, 19 Feb 2014 14:50:41 +0000 (+0100) Subject: interfaces: reset router and wlan capability bits X-Git-Tag: 0.7.8~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc160b8878585f2695c69e6df2db121c223f2d0f;p=thirdparty%2Flldpd.git 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. --- 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)