Bug 5749 - cannot resolve L2 ep for ext GW 97/37797/2
authorTomas Cechvala <tcechval@cisco.com>
Tue, 19 Apr 2016 11:07:37 +0000 (13:07 +0200)
committerTomas Cechvala <tcechval@cisco.com>
Tue, 19 Apr 2016 11:26:50 +0000 (11:26 +0000)
Subnet GW may also be an external endpoint.
It has not been considered before.

Change-Id: I260c151608c2e28e769708f1a4d7e57f4bf7619c
Signed-off-by: Tomas Cechvala <tcechval@cisco.com>
renderers/ofoverlay/src/main/java/org/opendaylight/groupbasedpolicy/renderer/ofoverlay/endpoint/EndpointManager.java

index aa8124b72803dbcf914c4d1dd5f1f30c6463ba67..60b719f17994afa4ccf214ed93a05f41dc7084bb 100755 (executable)
@@ -648,7 +648,7 @@ public class EndpointManager implements AutoCloseable {
      * @return {@link EndpointL3} if exists, otherwise null
      */
     public Endpoint getL2EndpointFromL3(EndpointL3 endpointL3) {
-        if(endpointL3 != null) {
+        if (endpointL3 != null) {
             L2BridgeDomainId l2Context = endpointL3.getL2Context();
             MacAddress macAddress = endpointL3.getMacAddress();
             if (l2Context == null || macAddress == null) {
@@ -657,9 +657,11 @@ public class EndpointManager implements AutoCloseable {
                 return null;
             }
             EpKey l2EndpointKey = new EpKey(l2Context, macAddress);
-            return endpoints.get(l2EndpointKey);
+            if (endpoints.get(l2EndpointKey) != null) {
+                return endpoints.get(l2EndpointKey);
+            }
+            return externalEndpointsWithoutLocation.get(l2EndpointKey);
         }
-
         return null;
     }