commit | 2c51531ab7cb514b30e4830b20541aa8a2f7e673 | [log] [tgz] |
---|---|---|
author | Pier Ventre <pierventre@hotmail.com> | Tue Sep 13 21:33:40 2016 -0700 |
committer | Pier Ventre <pierventre@hotmail.com> | Tue Sep 20 14:33:34 2016 -0700 |
tree | cac67e3c4eb466a2f4577a7bad1b599710b6674c | |
parent | 066aaa98d389e7b754b7f9012e737a9fc06e7783 [diff] |
[CORD-438] Fix Segment Routing application Changes: - Discards Link events if one of the switch is down; - Triggers the paths optimization after device-down event; Change-Id: I4114f2450401e0d1ff5658d592daf319d977f20e
diff --git a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java index 870ea06..d7e4c3c 100644 --- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java +++ b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java
@@ -662,6 +662,7 @@ if (updatedEcmpSpgMap != null) { updatedEcmpSpgMap.remove(deviceId); } + this.populateRoutingRulesForLinkStatusChange(null); } private final class RetryFilters implements Runnable {
diff --git a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java index fce63fe..72b6401 100644 --- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java +++ b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
@@ -693,6 +693,15 @@ if (event.type() == LinkEvent.Type.LINK_ADDED) { processLinkAdded((Link) event.subject()); } else if (event.type() == LinkEvent.Type.LINK_REMOVED) { + Link linkRemoved = (Link) event.subject(); + if (linkRemoved.src().elementId() instanceof DeviceId && + !deviceService.isAvailable(linkRemoved.src().deviceId())) { + continue; + } + if (linkRemoved.dst().elementId() instanceof DeviceId && + !deviceService.isAvailable(linkRemoved.dst().deviceId())) { + continue; + } processLinkRemoved((Link) event.subject()); } else if (event.type() == DeviceEvent.Type.DEVICE_ADDED || event.type() == DeviceEvent.Type.DEVICE_AVAILABILITY_CHANGED ||