From: Vincent Bernat Date: Tue, 14 May 2013 22:10:17 +0000 (+0200) Subject: sonmp: allow SONMP unittests to work without a global config X-Git-Tag: 0.7.4~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0728cb8205f7d3c285f4e8b502b0bb243c419824;p=thirdparty%2Flldpd.git sonmp: allow SONMP unittests to work without a global config --- diff --git a/src/daemon/sonmp.c b/src/daemon/sonmp.c index af89f322..665a160d 100644 --- a/src/daemon/sonmp.c +++ b/src/daemon/sonmp.c @@ -364,7 +364,8 @@ sonmp_decode(struct lldpd *cfg, char *frame, int s, goto malformed; } TAILQ_INSERT_TAIL(&chassis->c_mgmt, mgmt, m_entries); - chassis->c_ttl = cfg->g_config.c_tx_interval * cfg->g_config.c_tx_hold; + chassis->c_ttl = cfg?(cfg->g_config.c_tx_interval * cfg->g_config.c_tx_hold): + LLDPD_TTL; port->p_id_subtype = LLDP_PORTID_SUBTYPE_LOCAL; if (asprintf(&port->p_id, "%02x-%02x-%02x",