From: Yu Watanabe Date: Wed, 22 Nov 2023 20:19:24 +0000 (+0900) Subject: network: update MTU after CAN specific configs applied X-Git-Tag: v256-rc1~1515^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a60cc587d456c83e8bf77bc3d7fe3c9ed10f3c40;p=thirdparty%2Fsystemd.git network: update MTU after CAN specific configs applied Changing FD mode may trigger change of MTU and maximum MTU size. See kernel documents about CAN FD mode: https://docs.kernel.org/networking/can.html#can-fd-flexible-data-rate-driver-support --- diff --git a/src/network/networkd-setlink.c b/src/network/networkd-setlink.c index 2b37c86d235..854699833d0 100644 --- a/src/network/networkd-setlink.c +++ b/src/network/networkd-setlink.c @@ -563,12 +563,20 @@ static int link_is_ready_to_set_link(Link *link, Request *req) { break; } case REQUEST_TYPE_SET_LINK_MTU: { - Request req_ipoib = { - .link = link, - .type = REQUEST_TYPE_SET_LINK_IPOIB, - }; + if (ordered_set_contains(link->manager->request_queue, + &(const Request) { + .link = link, + .type = REQUEST_TYPE_SET_LINK_IPOIB, + })) + return false; - return !ordered_set_contains(link->manager->request_queue, &req_ipoib); + /* Changing FD mode may affect MTU. */ + if (ordered_set_contains(link->manager->request_queue, + &(const Request) { + .link = link, + .type = REQUEST_TYPE_SET_LINK_CAN, + })) + return false; } default: break;