From: Yu Watanabe Date: Sun, 15 Aug 2021 17:41:15 +0000 (+0900) Subject: network: SamplePoint= should be specified only when BitRate= is specified X-Git-Tag: v250-rc1~826^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=817561cc60d72373f738af27bb7e20b9c98261fe;p=thirdparty%2Fsystemd.git network: SamplePoint= should be specified only when BitRate= is specified See can_get_bittiming() in drivers/net/can/dev/bittiming.c of kernel. --- diff --git a/man/systemd.network.xml b/man/systemd.network.xml index 85e4ae09c75..c28cbed74f8 100644 --- a/man/systemd.network.xml +++ b/man/systemd.network.xml @@ -2957,7 +2957,8 @@ IPv6Token=prefixstable:2002:da8:1:: SamplePoint= Optional sample point in percent with one decimal (e.g. 75%, - 87.5%) or permille (e.g. 875‰). + 87.5%) or permille (e.g. 875‰). This will be ignored when + BitRate= is unspecified. diff --git a/src/network/networkd-can.c b/src/network/networkd-can.c index 105a2d64074..c4c71b82852 100644 --- a/src/network/networkd-can.c +++ b/src/network/networkd-can.c @@ -31,7 +31,7 @@ int can_set_netlink_message(Link *link, sd_netlink_message *m) { if (r < 0) return log_link_debug_errno(link, r, "Could not open IFLA_INFO_DATA container: %m"); - if (link->network->can_bitrate > 0 || link->network->can_sample_point > 0) { + if (link->network->can_bitrate > 0) { struct can_bittiming bt = { .bitrate = link->network->can_bitrate, .sample_point = link->network->can_sample_point, @@ -48,7 +48,7 @@ int can_set_netlink_message(Link *link, sd_netlink_message *m) { return log_link_debug_errno(link, r, "Could not append IFLA_CAN_BITTIMING attribute: %m"); } - if (link->network->can_data_bitrate > 0 || link->network->can_data_sample_point > 0) { + if (link->network->can_data_bitrate > 0) { struct can_bittiming bt = { .bitrate = link->network->can_data_bitrate, .sample_point = link->network->can_data_sample_point,