aboutsummaryrefslogtreecommitdiffstats
path: root/main/lxc
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-08-28 09:48:03 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2015-08-28 09:48:03 +0200
commitb9d2017fe6a6b3ba54d55b1c4afc3fd870b6debc (patch)
tree1e5154fa16a13a85a86c6a2a63589f5238e4865e /main/lxc
parentaf4a085513a49ab0eb30749c667e60bf7a2e6a98 (diff)
downloadaports-b9d2017fe6a6b3ba54d55b1c4afc3fd870b6debc.tar.bz2
aports-b9d2017fe6a6b3ba54d55b1c4afc3fd870b6debc.tar.xz
main/lxc: fix jumboframes in containers
Diffstat (limited to 'main/lxc')
-rw-r--r--main/lxc/0001-Clone-bridge-interface-MTU-setting.patch66
-rw-r--r--main/lxc/APKBUILD6
2 files changed, 71 insertions, 1 deletions
diff --git a/main/lxc/0001-Clone-bridge-interface-MTU-setting.patch b/main/lxc/0001-Clone-bridge-interface-MTU-setting.patch
new file mode 100644
index 0000000000..7f18e4f293
--- /dev/null
+++ b/main/lxc/0001-Clone-bridge-interface-MTU-setting.patch
@@ -0,0 +1,66 @@
+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
+
diff --git a/main/lxc/APKBUILD b/main/lxc/APKBUILD
index 279f21077f..bbd8a83249 100644
--- a/main/lxc/APKBUILD
+++ b/main/lxc/APKBUILD
@@ -4,7 +4,7 @@
pkgname=lxc
pkgver=1.1.3
_mypkgver=${pkgver/_rc/.rc}
-pkgrel=0
+pkgrel=1
pkgdesc="linux containers - tools"
url="http://lxc.sourceforge.net/"
arch="all"
@@ -18,6 +18,7 @@ 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
lxc.initd
"
@@ -88,11 +89,14 @@ dev() {
}
md5sums="680198729359bd5e58dc14ce617e72b1 lxc-1.1.3.tar.gz
+d41088af5dee2e2df7975bb33d5d1537 0001-Clone-bridge-interface-MTU-setting.patch
79e90616b5049a472ccdcb5b1dcdd8b1 version.patch
1e47412382517ee2adcbca00f07377ca lxc.initd"
sha256sums="b75fb8e376d3313e152f31fb7372b68f33a953a12191a39de4cded04fff94300 lxc-1.1.3.tar.gz
+e9a6c2e5f98a5f03bf772333c91efe7dafbc4f8d699dced73859e7d6c98d2d42 0001-Clone-bridge-interface-MTU-setting.patch
b6d85fb23940d2511b3951de56b2532843c0e03ec1613548366361cc0c1a46b9 version.patch
ce4c30c65832c4b79df1c3c1ef6a444247e2866ab24690f1476e7b98b722fac1 lxc.initd"
sha512sums="cafa4fbe4fe23b8c0b98007a79f20899c4a3b98c51d797b9c16e38dfec1eee5a513b58621308fe6551707d38028d9e5bd78ade8822691ffe4a7a369b10a48dda lxc-1.1.3.tar.gz
+6c4dc0a53ba8947a37faa14bb81a7bbed7a88fb118513842f5a5a37e9d23fbd2bee4f8f513d3f686a34d373869008ee5ccbd4b9e20615d4b9e4b8139119adce3 0001-Clone-bridge-interface-MTU-setting.patch
e2ffcbf55447291a8434a4f37255c3a6a119bc4116c75d205006aa2b070bf6be28535cf6107bead14bbf64bf9fa415346ab544bd1c15e1add7d1c6380e6b2def version.patch
4ff815d354f022854535a0069033f314263623ead48220d732683d5a268f14f221cbfe1aa9515adf1c2e47de71f1b1f1dda374a1f5f15d6f7025d2de91143d9a lxc.initd"