diff options
author | Ratan Gupta <ratagupt@linux.vnet.ibm.com> | 2019-10-03 14:04:54 +0300 |
---|---|---|
committer | Ratan Gupta <ratagupt@linux.vnet.ibm.com> | 2019-10-03 14:06:58 +0300 |
commit | 749dad7d539cd05fb636473929af20acaf35b30b (patch) | |
tree | 3766104366c1a4acdc6d6113f16c765c71ecf234 /redfish-core/lib/network_protocol.hpp | |
parent | 2e8a4fb85ff146ce965342a26602822571edafb9 (diff) | |
download | bmcweb-749dad7d539cd05fb636473929af20acaf35b30b.tar.xz |
Fix crash during GET of manager network protocol
If the ethernet interface is having the domain
name entry then Redfish GET request on network
manager protocol was crashing the bmcweb.
This commit fixes this behaviour.
Tested By:
Configure the Domain Name and run the GET request
on the network protocol: PASS
GET request on the network protocol even the
domain name was not configured : PASS
Redfish Validator: PASS
Signed-off-by: Ratan Gupta <ratagupt@linux.vnet.ibm.com>
Change-Id: I1e6cd6e3fe507ff375463ece1f6f10bae4d4fb6a
Diffstat (limited to 'redfish-core/lib/network_protocol.hpp')
-rw-r--r-- | redfish-core/lib/network_protocol.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/redfish-core/lib/network_protocol.hpp b/redfish-core/lib/network_protocol.hpp index d92315e1eb..71e58cc2c0 100644 --- a/redfish-core/lib/network_protocol.hpp +++ b/redfish-core/lib/network_protocol.hpp @@ -243,11 +243,12 @@ class NetworkProtocol : public Node asyncResp->res.jsonValue["NTP"]["NTPServers"] = ntpServers; if (hostName.empty() == false) { - asyncResp->res.jsonValue["FQDN"] = hostName; + std::string FQDN = std::move(hostName); if (domainNames.empty() == false) { - asyncResp->res.jsonValue["FQDN"] += "." + domainNames[0]; + FQDN += "." + domainNames[0]; } + asyncResp->res.jsonValue["FQDN"] = std::move(FQDN); } }); |