]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
interfaces: when no alias available, use interface name
authorVincent Bernat <vincent@bernat.im>
Mon, 8 Feb 2016 16:42:03 +0000 (17:42 +0100)
committerVincent Bernat <vincent@bernat.im>
Mon, 8 Feb 2016 16:42:03 +0000 (17:42 +0100)
Even if the interface name was already used as port ID.

src/daemon/interfaces.c

index 009a578472731cd318872acff3da1874754886d0..b3f99346cd5fdfbf19f4bdcfb9ca36ec7a2117b9 100644 (file)
@@ -524,6 +524,10 @@ interfaces_helper_port_name_desc(struct lldpd *cfg,
                free(port->p_descr);
                if (has_alias) {
                        port->p_descr = strdup(iface->alias);
+               } else {
+                       /* We don't have anything else to put here and for CDP
+                        * with need something non-NULL */
+                       port->p_descr = strdup(hardware->h_ifname);
                }
        } else {
                if (portid_type != LLDP_PORTID_SUBTYPE_LOCAL) {