/* We need to set the portid to what the client configured.
This can be done from the CLI.
*/
- int has_alias = (iface->alias != NULL && strlen(iface->alias) != 0);
+ int has_alias = (iface->alias != NULL
+ && strlen(iface->alias) != 0
+ && strncmp("lldpd: ", iface->alias, 7));
int portid_type = cfg->g_config.c_lldp_portid_type;
if (portid_type == LLDP_PORTID_SUBTYPE_IFNAME ||
(portid_type == LLDP_PORTID_SUBTYPE_UNKNOWN && has_alias) ||
# Alias should be set
alias = open("/sys/class/net/eth0/ifalias").read().strip()
assert alias == "lldpd: connected to ns-2.example.com"
+ # Alias should not be sent to neighbor
+ lldpcli("update")
+ time.sleep(1)
+ with namespaces(2):
+ out = lldpcli("-f", "keyvalue", "show", "neighbors", "details")
+ print(out)
+ assert out['lldp.eth1.port.descr'] == 'eth0'
+