diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-04-30 00:10:34 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-04-30 12:16:02 +0200 |
commit | 600b7898e8d1a09a0f48866fe2cc8bdab597538f (patch) | |
tree | 781bf5e7abef2cc595fba7910bb8bf425b963262 /src/network | |
parent | network: can: shorten code a bit (diff) | |
download | systemd-600b7898e8d1a09a0f48866fe2cc8bdab597538f.tar.xz systemd-600b7898e8d1a09a0f48866fe2cc8bdab597538f.zip |
network: do not try to configure address or etc on can device
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/networkd-can.c | 6 | ||||
-rw-r--r-- | src/network/networkd-link.c | 18 | ||||
-rw-r--r-- | src/network/networkd-link.h | 1 |
3 files changed, 25 insertions, 0 deletions
diff --git a/src/network/networkd-can.c b/src/network/networkd-can.c index 1279d1b89f..e448a1ad02 100644 --- a/src/network/networkd-can.c +++ b/src/network/networkd-can.c @@ -69,6 +69,9 @@ static int link_set_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link) log_link_debug(link, "Link set"); + link->can_configured = true; + link_check_ready(link); + return 1; } @@ -269,5 +272,8 @@ int link_configure_can(Link *link) { } } + link->can_configured = true; + link_check_ready(link); + return 0; } diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index c93cdf7bb1..7da08c5430 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -764,6 +764,15 @@ void link_check_ready(Link *link) { if (!link->network) return; + if (link->iftype == ARPHRD_CAN) { + /* let's shortcut things for CAN which doesn't need most of checks below. */ + if (!link->can_configured) + return (void) log_link_debug(link, "%s(): CAN device is not configured.", __func__); + + link_enter_configured(link); + return; + } + if (!link->addresses_configured) return (void) log_link_debug(link, "%s(): static addresses are not configured.", __func__); @@ -2076,6 +2085,7 @@ int link_configure(Link *link) { return r; if (link->iftype == ARPHRD_CAN) + /* let's shortcut things for CAN which doesn't need most of what's done below. */ return link_configure_can(link); r = link_set_sysctl(link); @@ -2567,6 +2577,10 @@ static int link_carrier_gained(Link *link) { assert(link); + if (link->iftype == ARPHRD_CAN) + /* let's shortcut things for CAN which doesn't need most of what's done below. */ + return link_handle_bound_by_list(link); + r = wifi_get_info(link); if (r < 0) return r; @@ -2625,6 +2639,10 @@ static int link_carrier_lost(Link *link) { if (link->network && link->network->ignore_carrier_loss) return 0; + if (link->iftype == ARPHRD_CAN) + /* let's shortcut things for CAN which doesn't need most of what's done below. */ + return link_handle_bound_by_list(link); + /* Some devices reset itself while setting the MTU. This causes the DHCP client fall into a loop. * setting_mtu keep track whether the device got reset because of setting MTU and does not drop the * configuration and stop the clients as well. */ diff --git a/src/network/networkd-link.h b/src/network/networkd-link.h index f4a2b1f240..541231b4b9 100644 --- a/src/network/networkd-link.h +++ b/src/network/networkd-link.h @@ -131,6 +131,7 @@ typedef struct Link { bool setting_genmode:1; bool ipv6_mtu_set:1; bool bridge_mdb_configured:1; + bool can_configured:1; bool activated:1; sd_dhcp_server *dhcp_server; |