diff options
author | Clemens Gruber <clemens.gruber@pqgruber.com> | 2020-08-21 16:03:23 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-08-26 14:35:32 +0200 |
commit | 21ce0f5b33bec757cb8c056fbe8b100991d2e022 (patch) | |
tree | 0f0ec8d36079a88c914c5b86671cf85da1dbec78 | |
parent | cab5cde8c9fa08169274161c64980468f9a36304 (diff) | |
download | systemd-21ce0f5b33bec757cb8c056fbe8b100991d2e022.tar.gz |
network: can: Fix CAN initialization
When introducing CAN-FD support, the .can_fd_mode was not initalized
with -1 and due to cm.mask containing the CAN_CTRLMODE_FD bit, it was
not ignored when FDMode was not configured but instead disabled.
The same thing happened when listen-only mode support was introduced.
On chips that do not support these features, this lead to an error:
can0: Failed to configure CAN link: Operation not supported
Fix it by intializing all the CAN related tristate variables
(.can_listen_only, .can_fd_mode and .can_non_iso) to -1.
(cherry picked from commit f594b5feabee38dded4b7ae288fba6c3b6c79a45)
-rw-r--r-- | src/network/networkd-network.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index d34155b19f..97f5551ee5 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -483,6 +483,9 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi .keep_configuration = _KEEP_CONFIGURATION_INVALID, .can_triple_sampling = -1, .can_termination = -1, + .can_listen_only = -1, + .can_fd_mode = -1, + .can_non_iso = -1, .ip_service_type = -1, }; |