Fix Delete IPv6StaticDefaultGateways
This commit fixes delete operation on IPv6StaticDefaultGateways
Tested by:
patch with null deletes IPv6 static default gateways
-d '{"IPv6StaticDefaultGateways": [null]}'
This change was missed in the below commit
[1] https://github.com/openbmc/bmcweb/commit/ce73d5c8517e0b85d85de345f10c82c24cbb067b
Change-Id: I012ba8f7b4c1c0b78b1b758f60875708a7db6b1d
Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index 34e7215..ee1ad78 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -922,10 +922,11 @@
* @return None
*/
inline void
- deleteIPv6Gateway(std::string_view gatewayId,
+ deleteIPv6Gateway(std::string_view ifaceId, std::string_view gatewayId,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
sdbusplus::message::object_path path("/xyz/openbmc_project/network");
+ path /= ifaceId;
path /= gatewayId;
crow::connections::systemBus->async_method_call(
[asyncResp](const boost::system::error_code& ec) {
@@ -984,6 +985,7 @@
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
sdbusplus::message::object_path path("/xyz/openbmc_project/network");
+ path /= ifaceId;
path /= gatewayId;
crow::connections::systemBus->async_method_call(
[asyncResp, ifaceId, gateway,
@@ -1044,7 +1046,7 @@
messages::resourceCannotBeDeleted(asyncResp->res);
return;
}
- deleteIPv6Gateway(staticGatewayEntry->id, asyncResp);
+ deleteIPv6Gateway(ifaceId, staticGatewayEntry->id, asyncResp);
return;
}
if (obj->empty())