Determines route IP by checking the interface config directly

Previously, SR checked the subnet data structure which contains
multiple subnets now in order to support generic routing.

A missing part of gerrit #11842.

Change-Id: Ia778c8ba5a42927d259c70bbb7538869270a7a1f
diff --git a/src/main/java/org/onosproject/segmentrouting/IcmpHandler.java b/src/main/java/org/onosproject/segmentrouting/IcmpHandler.java
index 21f00df..220d3f2 100644
--- a/src/main/java/org/onosproject/segmentrouting/IcmpHandler.java
+++ b/src/main/java/org/onosproject/segmentrouting/IcmpHandler.java
@@ -145,22 +145,22 @@
 
         Ip4Address destIpAddress = Ip4Address.valueOf(icmpReplyIpv4.getDestinationAddress());
         Ip4Address destRouterAddress = config.getRouterIpAddressForASubnetHost(destIpAddress);
-        int sid = config.getSegmentId(destRouterAddress);
-        if (sid < 0) {
+        int destSid = config.getSegmentId(destRouterAddress);
+        if (destSid < 0) {
             log.warn("Cannot find the Segment ID for {}", destAddress);
             return;
         }
 
-        sendPacketOut(outport, icmpReplyEth, sid);
+        sendPacketOut(outport, icmpReplyEth, destSid);
 
     }
 
-    private void sendPacketOut(ConnectPoint outport, Ethernet payload, int sid) {
+    private void sendPacketOut(ConnectPoint outport, Ethernet payload, int destSid) {
 
         IPv4 ipPacket = (IPv4) payload.getPayload();
         Ip4Address destIpAddress = Ip4Address.valueOf(ipPacket.getDestinationAddress());
 
-        if (sid == -1 || config.getSegmentId(payload.getDestinationMAC()) == sid ||
+        if (destSid == -1 || config.getSegmentId(payload.getDestinationMAC()) == destSid ||
                 config.inSameSubnet(outport.deviceId(), destIpAddress)) {
             TrafficTreatment treatment = DefaultTrafficTreatment.builder().
                     setOutput(outport.port()).build();
@@ -175,7 +175,7 @@
 
             payload.setEtherType(Ethernet.MPLS_UNICAST);
             MPLS mplsPkt = new MPLS();
-            mplsPkt.setLabel(sid);
+            mplsPkt.setLabel(destSid);
             mplsPkt.setTtl(((IPv4) payload.getPayload()).getTtl());
             mplsPkt.setPayload(payload.getPayload());
             payload.setPayload(mplsPkt);