From: Vincent Bernat Date: Sun, 24 May 2009 19:20:42 +0000 (+0200) Subject: When LLDP-MED is not enabled, do not send inventory. X-Git-Tag: 0.5.0~80 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=42bddd41f66da88992c66354347a20a1851ad39f;p=thirdparty%2Flldpd.git When LLDP-MED is not enabled, do not send inventory. --- diff --git a/src/lldpd.c b/src/lldpd.c index 2c9e1c53..358dc828 100644 --- a/src/lldpd.c +++ b/src/lldpd.c @@ -553,9 +553,11 @@ lldpd_port_add(struct lldpd *cfg, struct ifaddrs *ifa) hardware->h_start_probe = 0; hardware->h_proto_macs = (u_int8_t*)calloc(cfg->g_multi+1, ETH_ALEN); #ifdef ENABLE_LLDPMED - hardware->h_lport.p_med_cap_enabled = LLDPMED_CAP_CAP; - if (!cfg->g_noinventory) - hardware->h_lport.p_med_cap_enabled |= LLDPMED_CAP_IV; + if (cfg->g_lchassis.c_med_cap_available) { + hardware->h_lport.p_med_cap_enabled = LLDPMED_CAP_CAP; + if (!cfg->g_noinventory) + hardware->h_lport.p_med_cap_enabled |= LLDPMED_CAP_IV; + } #endif #ifdef ENABLE_DOT1 TAILQ_INIT(&hardware->h_lport.p_vlans); @@ -1537,7 +1539,8 @@ main(int argc, char *argv[]) cfg->g_lchassis.c_med_cap_available = LLDPMED_CAP_CAP | LLDPMED_CAP_IV | LLDPMED_CAP_LOCATION; cfg->g_noinventory = noinventory; - } + } else + cfg->g_noinventory = 1; #endif /* Set TTL */