routing_table: Deduplicate rebuilds

We don't need to rebuild the routing table for every single interface
and system configuration object. It now only rebuilds the table once
every refresh of the object tree.

Change-Id: I6cc1cfa1ee6ad17307e3e9c7a2eaa352675ba7e8
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/src/system_configuration.cpp b/src/system_configuration.cpp
index c37cfc6..d1c1ed0 100644
--- a/src/system_configuration.cpp
+++ b/src/system_configuration.cpp
@@ -3,7 +3,6 @@
 #include "system_configuration.hpp"
 
 #include "network_manager.hpp"
-#include "routing_table.hpp"
 
 #include <phosphor-logging/elog-errors.hpp>
 #include <phosphor-logging/log.hpp>
@@ -36,11 +35,10 @@
     bus(bus), manager(parent)
 {
     auto name = getHostNameFromSystem();
-    route::Table routingTable;
 
     SystemConfigIntf::hostName(name);
-    auto gatewayList = routingTable.getDefaultGateway();
-    auto gateway6List = routingTable.getDefaultGateway6();
+    const auto& gatewayList = manager.getRouteTable().getDefaultGateway();
+    const auto& gateway6List = manager.getRouteTable().getDefaultGateway6();
     // Assign first entry of gateway list
     std::string gateway;
     std::string gateway6;