Fix IPv6DefaultGateway validator warnings
This commit fixes below warnings
WARNING - IPv6DefaultGateway: Empty string found
Tested By:
Ran validator
Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>
Change-Id: Iac41feeb6cf245348f69915e0f58dd24ae46330e
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index 4dfef0f..cd0584c 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -1832,7 +1832,13 @@
}
}
- jsonResponse["IPv6DefaultGateway"] = ethData.ipv6_default_gateway;
+ std::string ipv6GatewayStr = ethData.ipv6_default_gateway;
+ if (ipv6GatewayStr.empty())
+ {
+ ipv6GatewayStr = "0:0:0:0:0:0:0:0";
+ }
+
+ jsonResponse["IPv6DefaultGateway"] = ipv6GatewayStr;
nlohmann::json& ipv6Array = jsonResponse["IPv6Addresses"];
nlohmann::json& ipv6StaticArray = jsonResponse["IPv6StaticAddresses"];