Bug 5749 - cannot resolve L2 ep for ext GW
[groupbasedpolicy.git] / 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;
     }