Verify unchanged host location when host is moved
When a dual homed host moves from [1A/1, 1B/1] to [1A/2, 1B/1], it is very likely that 1B side moves as well.
A verify probe should be sent on 1B/1 to see if the host is still there.
Change-Id: Ib40dcb51e0980a642e308ee3b883dc19551317df
diff --git a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/HostHandler.java b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/HostHandler.java
index 1690522..d4fbcad 100644
--- a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/HostHandler.java
+++ b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/HostHandler.java
@@ -201,9 +201,6 @@
// For each old location
Sets.difference(prevLocations, newLocations).forEach(prevLocation -> {
- // First of all, verify each old location
- srManager.probingService.probeHost(host, prevLocation, ProbeMode.VERIFY);
-
// Remove routing rules for old IPs
Sets.difference(prevIps, newIps).forEach(ip -> {
if (doubleTaggedHost) {
@@ -294,6 +291,7 @@
// Majorly for the 2nd step of [1A/x, 1B/x] -> [1A/x, 1B/y] -> [1A/y, 1B/y]
// But will also cover [1A/x] -> [1A/y] -> [1A/y, 1B/y]
if (srManager.activeProbing) {
+
srManager.getPairDeviceId(newLocation.deviceId()).ifPresent(pairDeviceId ->
srManager.getPairLocalPort(pairDeviceId).ifPresent(pairRemotePort ->
probe(host, newLocation, pairDeviceId, pairRemotePort)
@@ -323,6 +321,9 @@
hostMac, hostVlanId, ip, false);
}
});
+
+ // Verify existing location and see if it is still valid
+ srManager.probingService.probeHost(host, unchangedLocation, ProbeMode.VERIFY);
});
// ensure dual-homed host locations have viable uplinks