diff options
author | Ravi Teja <rbailapu@in.ibm.com> | 2019-07-30 08:53:50 +0300 |
---|---|---|
committer | Ed Tanous <ed.tanous@intel.com> | 2019-08-01 18:57:06 +0300 |
commit | c619141b47d5aaa5227a2a9ef0ef8ee6f0bef22f (patch) | |
tree | aecc9c4d2905ff7f1e942dcd20d3e31ead82cad7 | |
parent | dd118a2ed38b3b1093c44686d1b6c2e19d3485d1 (diff) | |
download | bmcweb-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.hpp | 5 |
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 ðiface_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; } |