The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/2978

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: tomponline <[email protected]>
From 006e135e225847ec29eb816c62ac6c22668de4d8 Mon Sep 17 00:00:00 2001
From: tomponline <[email protected]>
Date: Tue, 7 May 2019 12:13:46 +0100
Subject: [PATCH] network: Adds custom mtu support for ipvlan interfaces

Signed-off-by: tomponline <[email protected]>
---
 src/lxc/network.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/lxc/network.c b/src/lxc/network.c
index 5edd822b48..7214a09b35 100644
--- a/src/lxc/network.c
+++ b/src/lxc/network.c
@@ -478,6 +478,7 @@ static int instantiate_ipvlan(struct lxc_handler *handler, 
struct lxc_netdev *ne
 {
        char peerbuf[IFNAMSIZ], *peer;
        int err;
+       unsigned int mtu = 0;
 
        if (netdev->link[0] == '\0') {
                ERROR("No link for ipvlan network device specified");
@@ -504,6 +505,22 @@ static int instantiate_ipvlan(struct lxc_handler *handler, 
struct lxc_netdev *ne
                goto on_error;
        }
 
+       if (netdev->mtu) {
+               err = lxc_safe_uint(netdev->mtu, &mtu);
+               if (err < 0) {
+                       errno = -err;
+                       SYSERROR("Failed to parse mtu \"%s\" for interface 
\"%s\"", netdev->mtu, peer);
+                       goto on_error;
+               }
+
+               err = lxc_netdev_set_mtu(peer, mtu);
+               if (err < 0) {
+                       errno = -err;
+                       SYSERROR("Failed to set mtu \"%s\" for interface 
\"%s\"", netdev->mtu, peer);
+                       goto on_error;
+               }
+       }
+
        if (netdev->upscript) {
                char *argv[] = {
                    "ipvlan",
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to