]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/veth: also set MTU for peer interface
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 2 Nov 2021 03:25:12 +0000 (12:25 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 2 Nov 2021 03:25:15 +0000 (12:25 +0900)
Fixes #21206.

src/network/netdev/veth.c

index 840a3277b13f1a5d8ec1e978c14707b15e84a993..cdbbf3936145dafda53f6b835e159508e4bb9827 100644 (file)
@@ -34,6 +34,12 @@ static int netdev_veth_fill_message_create(NetDev *netdev, Link *link, sd_netlin
                         return log_netdev_error_errno(netdev, r, "Could not append IFLA_ADDRESS attribute: %m");
         }
 
+        if (netdev->mtu != 0) {
+                r = sd_netlink_message_append_u32(m, IFLA_MTU, netdev->mtu);
+                if (r < 0)
+                        return log_netdev_error_errno(netdev, r, "Could not append IFLA_MTU attribute: %m");
+        }
+
         r = sd_netlink_message_close_container(m);
         if (r < 0)
                 return log_netdev_error_errno(netdev, r, "Could not append IFLA_INFO_DATA attribute: %m");