1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-26 14:04:03 +03:00

network: move logging from ipoib_set_netlink_message() to the caller

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2022-01-04 21:34:21 +01:00
parent 2f64865b0e
commit eff692502b
2 changed files with 8 additions and 8 deletions

View File

@ -66,35 +66,35 @@ int ipoib_set_netlink_message(Link *link, sd_netlink_message *m) {
r = sd_netlink_message_set_flags(m, NLM_F_REQUEST | NLM_F_ACK);
if (r < 0)
return log_link_debug_errno(link, r, "Could not set netlink flags: %m");
return r;
r = sd_netlink_message_open_container(m, IFLA_LINKINFO);
if (r < 0)
return log_link_debug_errno(link, r, "Failed to open IFLA_LINKINFO container: %m");
return r;
r = sd_netlink_message_open_container_union(m, IFLA_INFO_DATA, link->kind);
if (r < 0)
return log_link_debug_errno(link, r, "Could not open IFLA_INFO_DATA container: %m");
return r;
if (link->network->ipoib_mode >= 0) {
r = sd_netlink_message_append_u16(m, IFLA_IPOIB_MODE, link->network->ipoib_mode);
if (r < 0)
return log_link_debug_errno(link, r, "Could not append IFLA_IPOIB_MODE attribute: %m");
return r;
}
if (link->network->ipoib_umcast >= 0) {
r = sd_netlink_message_append_u16(m, IFLA_IPOIB_UMCAST, link->network->ipoib_umcast);
if (r < 0)
return log_link_debug_errno(link, r, "Could not append IFLA_IPOIB_UMCAST attribute: %m");
return r;
}
r = sd_netlink_message_close_container(m);
if (r < 0)
return log_link_debug_errno(link, r, "Failed to close IFLA_INFO_DATA container: %m");
return r;
r = sd_netlink_message_close_container(m);
if (r < 0)
return log_link_debug_errno(link, r, "Failed to close IFLA_LINKINFO container: %m");
return r;
return 0;
}

View File

@ -476,7 +476,7 @@ static int link_configure(
case SET_LINK_IPOIB:
r = ipoib_set_netlink_message(link, req);
if (r < 0)
return r;
return log_link_debug_errno(link, r, "Could not create netlink message: %m");
break;
case SET_LINK_MASTER:
r = sd_netlink_message_append_u32(req, IFLA_MASTER, PTR_TO_UINT32(userdata));