Network: Implement ipv6/ipv4 default gateways on EthernetInterface
Currently ipv6/ipv4 default gateway properties on SystemConfiguration
interface which will be deprecated soon.
This commit is to add Default gateway properties implementation on
EthernetInterface.
Test by:
Set ipv4/v6 default gateway properties on ethernet interface.
Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>
Change-Id: I30da81d7ccf9d568a60bfdd179331b4c0d86b149
diff --git a/routing_table.cpp b/routing_table.cpp
index ffbeecb..68a9ee3 100644
--- a/routing_table.cpp
+++ b/routing_table.cpp
@@ -151,16 +151,16 @@
}
if (!dstAddr && gateWayAddr)
{
+ std::string ifNameStr(ifName);
if (rtMsg->rtm_family == AF_INET)
{
- defaultGateway = gatewayStr;
+ defaultGateway[ifNameStr] = gatewayStr;
}
else if (rtMsg->rtm_family == AF_INET6)
{
- defaultGateway6 = gatewayStr;
+ defaultGateway6[ifNameStr] = gatewayStr;
}
}
-
Entry route(dstStr, gatewayStr, ifName);
// if there is already existing route for this network
// then ignore the next one as it would not be used by the