Initialize the link status and interface status correctly
link status and interface status was not read from the system during
construction of interface object as it was under the compiler flag
NIC_SUPPORTS_ETHTOOL which is not required.
This commit fixes this behaviour.
TestedBy:
Started the network manager and check the values
for linkUp and NICEnabled property values.
Signed-off-by: Ratan Gupta <ratagupt@linux.vnet.ibm.com>
Change-Id: I69b008e2148ab668bfbdf877720c269d6b47b586
diff --git a/ethernet_interface.cpp b/ethernet_interface.cpp
index 4827f68..74c3a4b 100644
--- a/ethernet_interface.cpp
+++ b/ethernet_interface.cpp
@@ -85,13 +85,15 @@
MacAddressIntf::mACAddress(getMACAddress(intfName));
}
EthernetInterfaceIntf::nTPServers(getNTPServersFromConf());
+
+ EthernetInterfaceIntf::linkUp(linkUp());
+ EthernetInterfaceIntf::nICEnabled(nICEnabled());
+
#if NIC_SUPPORTS_ETHTOOL
InterfaceInfo ifInfo = EthernetInterface::getInterfaceInfo();
EthernetInterfaceIntf::autoNeg(std::get<2>(ifInfo));
EthernetInterfaceIntf::speed(std::get<0>(ifInfo));
- EthernetInterfaceIntf::linkUp(std::get<3>(ifInfo));
- EthernetInterfaceIntf::nICEnabled(std::get<4>(ifInfo));
#endif
// Emit deferred signal.