Commit 5177ae92 authored by Carlo Landmeter's avatar Carlo Landmeter

main/lxc: upgrade to 2.0.1

parent e09efa70
From e54864d3632e3959bed6dd6b7e6d2cbd7eb8eec0 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Fri, 21 Aug 2015 11:48:10 +0200
Subject: [PATCH] Clone bridge interface MTU setting
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Instead of require static mtu setting in config we simply clone the
existing MTU setting of the bridge interface.
This fixes issue when bridge interface has bigger MTU (like 9000 for
jumbo frame support) than the default 1500. When veth interface is
created it has by default MTU set to 1500 and when this is added to the
bridge, the kernel wee reduce the MTU for the bridge to 1500. We solve
this by cloning the MTU value from bridge interface.
This simplifies managing containers with bridge interface who supports
jumbo frames (mtu 9000) and makes it easier to move containers between
hosts with different MTU settings.
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
---
src/lxc/conf.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 309ceea..a3d45ee 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -2609,7 +2609,7 @@ static int instantiate_veth(struct lxc_handler *handler, struct lxc_netdev *netd
{
char veth1buf[IFNAMSIZ], *veth1;
char veth2buf[IFNAMSIZ], *veth2;
- int err;
+ int err, mtu = 0;
if (netdev->priv.veth_attr.pair) {
veth1 = netdev->priv.veth_attr.pair;
@@ -2655,12 +2655,18 @@ static int instantiate_veth(struct lxc_handler *handler, struct lxc_netdev *netd
}
if (netdev->mtu) {
- err = lxc_netdev_set_mtu(veth1, atoi(netdev->mtu));
+ mtu = atoi(netdev->mtu);
+ } else if (netdev->link) {
+ mtu = netdev_get_mtu(if_nametoindex(netdev->link));
+ }
+
+ if (mtu) {
+ err = lxc_netdev_set_mtu(veth1, mtu);
if (!err)
- err = lxc_netdev_set_mtu(veth2, atoi(netdev->mtu));
+ err = lxc_netdev_set_mtu(veth2, mtu);
if (err) {
- ERROR("failed to set mtu '%s' for veth pair (%s and %s): %s",
- netdev->mtu, veth1, veth2, strerror(-err));
+ ERROR("failed to set mtu '%i' for veth pair (%s and %s): %s",
+ mtu, veth1, veth2, strerror(-err));
goto out_delete;
}
}
--
2.5.0
......@@ -2,9 +2,9 @@
# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lxc
pkgver=1.1.5
pkgver=2.0.1
_mypkgver=${pkgver/_rc/.rc}
pkgrel=6
pkgrel=0
pkgdesc="linux containers - tools"
url="http://lxc.sourceforge.net/"
arch="all"
......@@ -18,10 +18,8 @@ options="suid"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lvm lua5.2-lxc:_lua52
$pkgname-templates $pkgname-libs"
source="https://github.com/lxc/lxc/archive/lxc-$_mypkgver.tar.gz
0001-Clone-bridge-interface-MTU-setting.patch
version.patch
download-template-tmpfs.patch
setproctitle-info-not-warn.patch
lxc.initd
"
......@@ -91,21 +89,15 @@ dev() {
"$pkgdir"/usr/bin/ || return 1
}
md5sums="a7a1b0699bce6fdc31cd512afeff479e lxc-1.1.5.tar.gz
d41088af5dee2e2df7975bb33d5d1537 0001-Clone-bridge-interface-MTU-setting.patch
md5sums="ce81d121e8fb7d7d75c3f992e334f1cb lxc-2.0.1.tar.gz
79e90616b5049a472ccdcb5b1dcdd8b1 version.patch
e8fd932f3ec6d52d7b4c183fc58c0b24 download-template-tmpfs.patch
bd7419669ed6c5578d876ef8a4d06c38 setproctitle-info-not-warn.patch
8ffde5bd9bfec77d14a8013c780074ca lxc.initd"
sha256sums="eefce4cc679656cb8636bf0849f3ba6981c48167884e13dbcb377820a717c09c lxc-1.1.5.tar.gz
e9a6c2e5f98a5f03bf772333c91efe7dafbc4f8d699dced73859e7d6c98d2d42 0001-Clone-bridge-interface-MTU-setting.patch
sha256sums="543b927e0be6df256562afe05281552645c78c4a9c0881bf313e31ae13679a29 lxc-2.0.1.tar.gz
b6d85fb23940d2511b3951de56b2532843c0e03ec1613548366361cc0c1a46b9 version.patch
8cb638f927d51f05884439e6db15092e902a9c59ef830cbdcb07d88f5cff11e1 download-template-tmpfs.patch
d5a2194d1d9dc8b171668532b8f8f26d0e1a4bb8fcea9694d28a5fbc850698ad setproctitle-info-not-warn.patch
dc39d869a2a690f7dcc9186c2707ed6c7ae2cd5248a9c062f3cb0ce4de73295b lxc.initd"
sha512sums="e48ab549f1317afcb5f7768ab988ba27a3e9f1458504e1d70b2e27c502233e7b3538b8ce0b79940140a59a37681bcd8e459416e814f9e4814a4ed86b89e8df1c lxc-1.1.5.tar.gz
6c4dc0a53ba8947a37faa14bb81a7bbed7a88fb118513842f5a5a37e9d23fbd2bee4f8f513d3f686a34d373869008ee5ccbd4b9e20615d4b9e4b8139119adce3 0001-Clone-bridge-interface-MTU-setting.patch
sha512sums="f64cc7167bfed1cc74689bf7d9a5b1ad5b957d5791529c8319c55d2cc671dbd00df9c08fb8f10f73c0d77465a54eb4c98c980e66dd888f52c7670640c6bbf78f lxc-2.0.1.tar.gz
e2ffcbf55447291a8434a4f37255c3a6a119bc4116c75d205006aa2b070bf6be28535cf6107bead14bbf64bf9fa415346ab544bd1c15e1add7d1c6380e6b2def version.patch
b3b8c47a8594cefff58cef74efe9e6bf0dd8422a40289c4398ea34e61d04dd3d95c567e880a4b123df42ffac3fae179b63b130b357eb6659f73f922f2908d971 download-template-tmpfs.patch
b839650c9be38a7c6e9c327c04433ec72043cca039bed34c6b8a30d1ce5fa9ed40ae71ab6bb7e7b2cd144af7670bbe4737d5a86e61e31cd006aa6234b93256ec setproctitle-info-not-warn.patch
82c8cdae3cf39a00205bb38a87561ba5b603c046c2438bfd897fc5ee4a2d1d5fde0431cb471f51b2e92cb76f795832ea9cb2f7494e4d67e7131aae2a6d6c29b2 lxc.initd"
### If you want the fancy proctitles, then you need to enable
### CONFIG_CHECKPOINT_RESTORE in your kernel.
--- a/src/lxc/utils.c
+++ b/src/lxc/utils.c
@@ -1458,7 +1458,7 @@ int setproctitle(char *title)
if (ret == 0)
strcpy((char*)arg_start, title);
else
- SYSERROR("setting cmdline failed");
+ INFO("setting cmdline failed - %s", strerror(errno));
return ret;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment