[ONOS-7320] Ensure link times are reset when mastership is reassigned to another node
Change-Id: I4134097a0d9da250484f6913630acc550ce4b41a
diff --git a/providers/lldp/src/main/java/org/onosproject/provider/lldp/impl/LldpLinkProvider.java b/providers/lldp/src/main/java/org/onosproject/provider/lldp/impl/LldpLinkProvider.java
index 72b3ea3..87ca7d7 100644
--- a/providers/lldp/src/main/java/org/onosproject/provider/lldp/impl/LldpLinkProvider.java
+++ b/providers/lldp/src/main/java/org/onosproject/provider/lldp/impl/LldpLinkProvider.java
@@ -566,7 +566,7 @@
private class InternalRoleListener implements MastershipListener {
@Override
public void event(MastershipEvent event) {
- if (MastershipEvent.Type.MASTER_CHANGED.equals(event.type())) {
+ if (event.type() == MastershipEvent.Type.MASTER_CHANGED) {
// only need new master events
eventExecutor.execute(() -> {
DeviceId deviceId = event.subject();
@@ -575,9 +575,7 @@
log.debug("Device {} doesn't exist, or isn't there yet", deviceId);
return;
}
- if (clusterService.getLocalNode().id().equals(event.roleInfo().master())) {
- updateDevice(device).ifPresent(ld -> updatePorts(ld, device.id()));
- }
+ updateDevice(device).ifPresent(ld -> updatePorts(ld, device.id()));
});
}
}