]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
sonmp: allow SONMP unittests to work without a global config
authorVincent Bernat <bernat@luffy.cx>
Tue, 14 May 2013 22:10:17 +0000 (00:10 +0200)
committerVincent Bernat <bernat@luffy.cx>
Tue, 14 May 2013 22:10:17 +0000 (00:10 +0200)
src/daemon/sonmp.c

index af89f3225b5430dd3b1de847982f76402d446960..665a160df35c646a3beb930018a1a8185846af81 100644 (file)
@@ -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",