DHCPv[46] relay must replace the route instead of adding an extra NH

Currently DHCP relay adds an extra next-hop to an already existing route (if any). Instead
it must replace it with the new one.

This patch adds replaceRoute method to the RouteStore interface and corresponding implementations.
The DHCP relay implementation uses the new method instead of updateRoute

Change-Id: I601613168b83290db4e53d2aae5c86e963ae17b0
diff --git a/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/Dhcp4HandlerImpl.java b/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/Dhcp4HandlerImpl.java
index 424b628..04a9967 100644
--- a/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/Dhcp4HandlerImpl.java
+++ b/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/Dhcp4HandlerImpl.java
@@ -1479,7 +1479,7 @@
             }
 
             Route route = new Route(Route.Source.DHCP, ip.toIpPrefix(), nextHopIp);
-            routeStore.updateRoute(route);
+            routeStore.replaceRoute(route);
         }
     }
 
diff --git a/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/Dhcp6HandlerImpl.java b/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/Dhcp6HandlerImpl.java
index 73ddc5f..b47e1ed 100644
--- a/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/Dhcp6HandlerImpl.java
+++ b/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/Dhcp6HandlerImpl.java
@@ -966,7 +966,7 @@
                 if (isMsgReply) {
                     Route routeForIP = new Route(Route.Source.DHCP, ipInfo.ip6Address.toIpPrefix(), nextHopIp);
                     log.debug("adding Route of 128 address for indirectly connected.");
-                    routeStore.updateRoute(routeForIP);
+                    routeStore.replaceRoute(routeForIP);
                 }
             }
 
@@ -977,7 +977,7 @@
                 if (isMsgReply) {
                     Route routeForPrefix = new Route(Route.Source.DHCP, pdInfo.pdPrefix, nextHopIp);
                     log.debug("adding Route of PD for indirectly connected.");
-                    routeStore.updateRoute(routeForPrefix);
+                    routeStore.replaceRoute(routeForPrefix);
                     if (this.dhcpFpmEnabled) {
                         FpmRecord fpmRecord = new FpmRecord(pdInfo.pdPrefix, nextHopIp, FpmRecord.Type.DHCP_RELAY);
                         dhcpFpmPrefixStore.addFpmRecord(pdInfo.pdPrefix, fpmRecord);