]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: allow to configure interface MTU for CAN devices
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 7 Dec 2023 09:57:13 +0000 (18:57 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 8 Dec 2023 01:47:42 +0000 (10:47 +0900)
Previously, even if MTUBytes= is specified in matching .network file,
the setting was ignored for CAN devices.

src/network/networkd-link.c

index aad86eed9911281ef97de3bf4f5332fef742d7db..a063696c82b12a7d073edf4c0951efb420f70f5f 100644 (file)
@@ -1049,6 +1049,10 @@ static int link_configure(Link *link) {
         if (r < 0)
                 return r;
 
+        r = link_configure_mtu(link);
+        if (r < 0)
+                return r;
+
         if (link->iftype == ARPHRD_CAN) {
                 /* let's shortcut things for CAN which doesn't need most of what's done below. */
                 r = link_request_to_set_can(link);
@@ -1082,10 +1086,6 @@ static int link_configure(Link *link) {
         if (r < 0)
                 return r;
 
-        r = link_configure_mtu(link);
-        if (r < 0)
-                return r;
-
         r = link_request_to_set_addrgen_mode(link);
         if (r < 0)
                 return r;