From: Alexandru Ardelean Date: Thu, 2 Apr 2015 07:40:13 +0000 (+0300) Subject: daemon/protocols/lldp.c: do not send system capabilities if none available X-Git-Tag: 0.7.15~45^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7d67839872b367839e5b85853e09a0ecf5776c96;p=thirdparty%2Flldpd.git daemon/protocols/lldp.c: do not send system capabilities if none available Signed-off-by: Alexandru Ardelean --- diff --git a/src/daemon/protocols/lldp.c b/src/daemon/protocols/lldp.c index 0d68e5de..108a3f73 100644 --- a/src/daemon/protocols/lldp.c +++ b/src/daemon/protocols/lldp.c @@ -146,12 +146,14 @@ static int _lldp_send(struct lldpd *global, } /* System capabilities */ - if (!( - POKE_START_LLDP_TLV(LLDP_TLV_SYSTEM_CAP) && - POKE_UINT16(chassis->c_cap_available) && - POKE_UINT16(chassis->c_cap_enabled) && - POKE_END_LLDP_TLV)) - goto toobig; + if (chassis->c_cap_available) { + if (!( + POKE_START_LLDP_TLV(LLDP_TLV_SYSTEM_CAP) && + POKE_UINT16(chassis->c_cap_available) && + POKE_UINT16(chassis->c_cap_enabled) && + POKE_END_LLDP_TLV)) + goto toobig; + } /* Management addresses */ TAILQ_FOREACH(mgmt, &chassis->c_mgmt, m_entries) {