summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRavi Teja <rbailapu@in.ibm.com>2019-07-30 08:53:50 +0300
committerEd Tanous <ed.tanous@intel.com>2019-08-01 18:57:06 +0300
commitc619141b47d5aaa5227a2a9ef0ef8ee6f0bef22f (patch)
treeaecc9c4d2905ff7f1e942dcd20d3e31ead82cad7
parentdd118a2ed38b3b1093c44686d1b6c2e19d3485d1 (diff)
downloadbmcweb-c619141b47d5aaa5227a2a9ef0ef8ee6f0bef22f.tar.xz
Redfish(Network): IPV4 DHCP ipaddreses dont show gateway when in DHCP mode
Tested by: configuring DHCP, GET https://${BMC_IP}/redfish/v1/Managers/bmc/EthernetInterfaces/eth0 Signed-off-by: Ravi Teja <raviteja28031990@gmail.com> Change-Id: Ic7067db41fbb8327ef55cc7552f9153d1ecfb63a
-rw-r--r--redfish-core/lib/ethernet.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index 266705286c..79322100e0 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -855,8 +855,9 @@ void getEthernetIfaceData(const std::string &ethiface_id,
// Fix global GW
for (IPv4AddressData &ipv4 : ipv4Data)
{
- if ((ipv4.linktype == LinkType::Global) &&
- (ipv4.gateway == "0.0.0.0"))
+ if (((ipv4.linktype == LinkType::Global) &&
+ (ipv4.gateway == "0.0.0.0")) ||
+ (ipv4.origin == "DHCP"))
{
ipv4.gateway = ethData.default_gateway;
}