From ebc8f714affcab2f221f9f4401dfb0f431abd96a Mon Sep 17 00:00:00 2001 From: Jonathan Hart Date: Thu, 14 May 2015 20:08:47 -0700 Subject: [PATCH] Fix for MP2S intent with ingress/egress on same switch. Fixes ONOS-1872 to enable support for 2 external SDN-IP connections on the same switch. Change-Id: I4475485f2f611c61e33ca34f17bef1950c3b4ed8 --- ...MultiPointToSinglePointIntentCompiler.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/MultiPointToSinglePointIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/MultiPointToSinglePointIntentCompiler.java index 825dc57b3c..6f12c52805 100644 --- a/core/net/src/main/java/org/onosproject/net/intent/impl/MultiPointToSinglePointIntentCompiler.java +++ b/core/net/src/main/java/org/onosproject/net/intent/impl/MultiPointToSinglePointIntentCompiler.java @@ -15,13 +15,8 @@ */ package org.onosproject.net.intent.impl; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; import org.apache.felix.scr.annotations.Activate; import org.apache.felix.scr.annotations.Component; import org.apache.felix.scr.annotations.Deactivate; @@ -40,8 +35,12 @@ import org.onosproject.net.intent.PointToPointIntent; import org.onosproject.net.resource.LinkResourceAllocations; import org.onosproject.net.topology.PathService; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Sets; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; /** * An intent compiler for @@ -73,6 +72,9 @@ public class MultiPointToSinglePointIntentCompiler Map links = new HashMap<>(); for (ConnectPoint ingressPoint : intent.ingressPoints()) { + if (ingressPoint.deviceId().equals(intent.egressPoint().deviceId())) { + continue; + } Path path = getPath(ingressPoint, intent.egressPoint()); for (Link link : path.links()) { if (links.containsKey(link.src().deviceId())) {