diff options
author | Ravi Teja <raviteja28031990@gmail.com> | 2024-02-23 18:03:43 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2024-03-05 18:55:18 +0300 |
commit | 91c441ecd8603d6ba6c64e52dded5b300b2eec01 (patch) | |
tree | fa120b0f51c3d5a347a6cb5b79ab565cadbc5cda /redfish-core | |
parent | 33e1f122b740c5de679dc0350b5f41e8d975499f (diff) | |
download | bmcweb-91c441ecd8603d6ba6c64e52dded5b300b2eec01.tar.xz |
DHCP Conf: Fix UseDomainName configuration
This commit modifies to use DomainEnabled D-bus property
Currently "UseDomainName" configuration is actually not controlling
DomainName setting in the backend networkd and networkd.
Networkd app does not have DomainName D-bus property implemented
and wrong D-bus property is being used in the bmcweb.
This fix make sure bmcweb uses DomainEnabled property and controls
UseDomainName configuration.
Here is backend networkd fix for DomainEnabled property
https://gerrit.openbmc.org/c/openbmc/phosphor-networkd/+/69604
Tested by:
Enabled DHCPv4 on one of the interface
Enable/Disable UseDomainName
Check if DHCP configured domain name configuration on BMC.
Change-Id: I68b86d4107a17db921ec463f5660a58aaa1396e3
Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>
Diffstat (limited to 'redfish-core')
-rw-r--r-- | redfish-core/lib/ethernet.hpp | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp index 03b23e1406..1574d81317 100644 --- a/redfish-core/lib/ethernet.hpp +++ b/redfish-core/lib/ethernet.hpp @@ -82,6 +82,8 @@ struct EthernetInterfaceData bool autoNeg; bool dnsv4Enabled; bool dnsv6Enabled; + bool domainv4Enabled; + bool domainv6Enabled; bool ntpv4Enabled; bool ntpv6Enabled; bool hostNamev4Enabled; @@ -390,6 +392,15 @@ inline bool extractEthernetInterfaceData( ethData.dnsv4Enabled = *dnsEnabled; } } + else if (propertyPair.first == "DomainEnabled") + { + const bool* domainEnabled = + std::get_if<bool>(&propertyPair.second); + if (domainEnabled != nullptr) + { + ethData.domainv4Enabled = *domainEnabled; + } + } else if (propertyPair.first == "NTPEnabled") { const bool* ntpEnabled = @@ -431,6 +442,15 @@ inline bool extractEthernetInterfaceData( ethData.dnsv6Enabled = *dnsEnabled; } } + if (propertyPair.first == "DomainEnabled") + { + const bool* domainEnabled = + std::get_if<bool>(&propertyPair.second); + if (domainEnabled != nullptr) + { + ethData.domainv6Enabled = *domainEnabled; + } + } else if (propertyPair.first == "NTPEnabled") { const bool* ntpEnabled = @@ -1237,8 +1257,8 @@ inline void handleDHCPPatch(const std::string& ifaceId, nextNTPv6 = *v6dhcpParms.useNtpServers; } - bool nextUsev4Domain = ethData.hostNamev4Enabled; - bool nextUsev6Domain = ethData.hostNamev6Enabled; + bool nextUsev4Domain = ethData.domainv4Enabled; + bool nextUsev6Domain = ethData.domainv6Enabled; if (v4dhcpParms.useDomainName) { nextUsev4Domain = *v4dhcpParms.useDomainName; @@ -1257,8 +1277,8 @@ inline void handleDHCPPatch(const std::string& ifaceId, BMCWEB_LOG_DEBUG("set NTPEnabled..."); setDHCPConfig("NTPEnabled", nextNTPv4, asyncResp, ifaceId, NetworkType::dhcp4); - BMCWEB_LOG_DEBUG("set HostNameEnabled..."); - setDHCPConfig("HostNameEnabled", nextUsev4Domain, asyncResp, ifaceId, + BMCWEB_LOG_DEBUG("set DomainEnabled..."); + setDHCPConfig("DomainEnabled", nextUsev4Domain, asyncResp, ifaceId, NetworkType::dhcp4); BMCWEB_LOG_DEBUG("set DNSEnabled for dhcp6..."); setDHCPConfig("DNSEnabled", nextDNSv6, asyncResp, ifaceId, @@ -1266,8 +1286,8 @@ inline void handleDHCPPatch(const std::string& ifaceId, BMCWEB_LOG_DEBUG("set NTPEnabled for dhcp6..."); setDHCPConfig("NTPEnabled", nextNTPv6, asyncResp, ifaceId, NetworkType::dhcp6); - BMCWEB_LOG_DEBUG("set HostNameEnabled for dhcp6..."); - setDHCPConfig("HostNameEnabled", nextUsev6Domain, asyncResp, ifaceId, + BMCWEB_LOG_DEBUG("set DomainEnabled for dhcp6..."); + setDHCPConfig("DomainEnabled", nextUsev6Domain, asyncResp, ifaceId, NetworkType::dhcp6); } |