Don't update the route entry for the existing network

As per the linux routing policy it always takes the
first matched route for the given network.

Change-Id: I1d9722fd773f3ba4619225f9d06d1db7da9b69c5
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/routing_table.cpp b/routing_table.cpp
index 54b3f86..6630a58 100644
--- a/routing_table.cpp
+++ b/routing_table.cpp
@@ -151,7 +151,15 @@
     gatewayStr = inet_ntoa(gateWayAddr);
 
     Entry route(dstStr, gatewayStr, ifName);
-    routeList.emplace(std::make_pair(dstStr, std::move(route)));
+    // if there is already existing route for this network
+    // then ignore the next one as it would not be used by the
+    // routing policy
+    // So don't update the route entry for the network for which
+    // there is already a route exist.
+    if (routeList.find(dstStr) == routeList.end())
+    {
+        routeList.emplace(std::make_pair(dstStr, std::move(route)));
+    }
 }
 
 Map Table::getRoutes()