network: fix configuring of CAN devices

Fix a bug introduced by 7558f9e717.

Fixes #20428.
This commit is contained in:
Yu Watanabe
2021-08-12 11:44:13 +02:00
committed by Lennart Poettering
parent da9c8911b4
commit 1e8cce8f1e
+5 -1
View File
@@ -229,10 +229,14 @@ static int link_configure(
log_link_debug(link, "Setting %s", set_link_operation_to_string(op));
if (IN_SET(op, SET_LINK_BOND, SET_LINK_CAN)) {
if (op == SET_LINK_BOND) {
r = sd_rtnl_message_new_link(link->manager->rtnl, &req, RTM_NEWLINK, link->master_ifindex);
if (r < 0)
return log_link_debug_errno(link, r, "Could not allocate RTM_NEWLINK message: %m");
} else if (op == SET_LINK_CAN) {
r = sd_rtnl_message_new_link(link->manager->rtnl, &req, RTM_NEWLINK, link->ifindex);
if (r < 0)
return log_link_debug_errno(link, r, "Could not allocate RTM_NEWLINK message: %m");
} else {
r = sd_rtnl_message_new_link(link->manager->rtnl, &req, RTM_SETLINK, link->ifindex);
if (r < 0)