bugfix

Change-Id: I07e35f64c7b15bb7a14e8695bb2ebbdbf5ae3d41
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingIcmpHandler.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingIcmpHandler.java
index f82b1c5..292ea3f 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingIcmpHandler.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingIcmpHandler.java
@@ -195,17 +195,16 @@
             return;
         }
 
-        ExternalPeerRouter externalPeerRouter = externalPeerRouter(srcSubnet);
-        if (externalPeerRouter == null) {
-            log.info(ERR_REQ + "failed to get external peer router");
-            return;
-        }
-
         if (isForSubnetGateway(IpAddress.valueOf(ipPacket.getDestinationAddress()),
                 srcSubnet)) {
             // this is a request for the subnet gateway
             processRequestForGateway(ipPacket, instPort);
         } else {
+            ExternalPeerRouter externalPeerRouter = externalPeerRouter(srcSubnet);
+            if (externalPeerRouter == null) {
+                log.info(ERR_REQ + "failed to get external peer router");
+                return;
+            }
             // this is a request for the external network
             IpAddress externalIp = getExternalIp(srcSubnet);
             if (externalIp == null) {