summaryrefslogtreecommitdiff
path: root/src/network/networkd-can.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-04-30 07:03:13 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-04-30 19:16:15 +0900
commitd9fc3b0da97924d778a5d77316fa55302918b156 (patch)
tree960b2153a1d74682f79efddc171397d9550c9176 /src/network/networkd-can.c
parent04952b25e81a137c9357fcf499527c6b713d50b9 (diff)
downloadsystemd-d9fc3b0da97924d778a5d77316fa55302918b156.tar.gz
network: make CAN device follow activation policy
Diffstat (limited to 'src/network/networkd-can.c')
-rw-r--r--src/network/networkd-can.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/network/networkd-can.c b/src/network/networkd-can.c
index e448a1ad02..787cfd711e 100644
--- a/src/network/networkd-can.c
+++ b/src/network/networkd-can.c
@@ -69,6 +69,12 @@ static int link_set_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link)
log_link_debug(link, "Link set");
+ r = link_activate(link);
+ if (r < 0) {
+ link_enter_failed(link);
+ return 1;
+ }
+
link->can_configured = true;
link_check_ready(link);
@@ -220,9 +226,6 @@ static int link_set_can(Link *link) {
link_ref(link);
- if (!(link->flags & IFF_UP))
- return link_up(link);
-
return 0;
}
@@ -264,13 +267,9 @@ int link_configure_can(Link *link) {
return r;
}
- if (!(link->flags & IFF_UP)) {
- r = link_up(link);
- if (r < 0) {
- link_enter_failed(link);
- return r;
- }
- }
+ r = link_activate(link);
+ if (r < 0)
+ return r;
link->can_configured = true;
link_check_ready(link);