lldpd (1.0.14)
* Fix:
+ Update seccomp rules for newer kernel/libc (#488)
+ + Correctly handle an interface whose index has changed (#490)
lldpd (1.0.13)
* Fix:
created = 1;
}
if (hardware->h_flags) continue;
- if (hardware->h_ops != &bond_ops) {
+ if (hardware->h_ops != &bond_ops || hardware->h_ifindex_changed) {
if (!created) {
log_debug("interfaces",
"bond %s is converted from another type of interface",
} else bmaster = hardware->h_data;
bmaster->index = master->index;
strlcpy(bmaster->name, master->name, IFNAMSIZ);
- if (hardware->h_ops != &bond_ops) {
+ if (hardware->h_ops != &bond_ops || hardware->h_ifindex_changed) {
if (iface_bond_init(cfg, hardware) != 0) {
log_warn("interfaces", "unable to initialize %s",
hardware->h_ifname);
}
if (hardware->h_flags)
continue;
- if (hardware->h_ops != ops) {
+ if (hardware->h_ops != ops || hardware->h_ifindex_changed) {
if (!created) {
log_debug("interfaces",
"interface %s is converted from another type of interface",
TAILQ_FOREACH(hardware, &cfg->g_hardware, h_entries) {
if (strcmp(hardware->h_ifname, name) == 0) {
if (hardware->h_flags == 0) {
+ if (hardware->h_ifindex != 0 &&
+ hardware->h_ifindex != index) {
+ log_debug("interfaces", "%s changed index: from %d to %d",
+ hardware->h_ifname, hardware->h_ifindex, index);
+ hardware->h_ifindex_changed = 1;
+ }
hardware->h_ifindex = index;
break;
}
}
/* Compare with the previous value */
- if (hardware->h_lport_previous &&
+ if (!hardware->h_ifindex_changed &&
+ hardware->h_lport_previous &&
output_len == hardware->h_lport_previous_len &&
!memcmp(output, hardware->h_lport_previous, output_len)) {
log_debug("localchassis",
log_debug("localchassis",
"change detected for port %s, resetting its timer",
hardware->h_ifname);
+ hardware->h_ifindex_changed = 0;
levent_schedule_pdu(hardware);
}
removed if this is left
to 0. */
int h_ifindex; /* Interface index, used by SNMP */
+ int h_ifindex_changed; /* Interface index has changed */
char h_ifname[IFNAMSIZ]; /* Should be unique */
u_int8_t h_lladdr[ETHER_ADDR_LEN];
assert out['lldp.eth0.rid'] == out['lldp.eth2.rid'] # Same chassis
+def test_remove_add_interface(lldpd, lldpcli, namespaces, links):
+ links(namespaces(1), namespaces(2))
+ with namespaces(1):
+ lldpd()
+ links.remove('eth0')
+ links.count = 0 # Ack to reset interface count
+ links(namespaces(1), namespaces(2))
+ time.sleep(2) # lldpd(1) should process the change
+ with namespaces(2):
+ lldpd()
+ with namespaces(1):
+ lldpcli("update")
+ time.sleep(2) # lldpd(2) should receive the LLDPDU
+ with namespaces(2):
+ out = lldpcli("-f", "keyvalue", "show", "neighbors", "details")
+ print(1, "out", out)
+ assert out['lldp.eth1.port.descr'] == 'eth0'
+
+
def test_set_interface_description(lldpd, lldpcli, namespaces, links):
links(namespaces(1), namespaces(2))
with namespaces(1):
out = lldpcli("-f", "keyvalue", "show", "neighbors", "details")
assert out['lldp.eth1.port.descr'] == 'eth0'
+