]> git.proxmox.com Git - pve-manager.git/commitdiff
add mtu support for manual interfaces
authorAlexandre Derumier <aderumier@odiso.com>
Tue, 31 Dec 2013 08:40:01 +0000 (09:40 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 31 Dec 2013 09:15:31 +0000 (10:15 +0100)
tested with classic linux interfaces/bridge and openvswitch interfaces

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Makefile
debian/conffiles
mtu [new file with mode: 0755]

index dc15a87aaf2ee77d87866f95b4c57413ff914737..9c8bf647da0951fe72f0263d57080cc6e7877bbf 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -79,7 +79,7 @@ aplupload:
        scp aplinfo/aplinfo.dat aplinfo.dat.gz aplinfo/aplinfo.dat.asc download1.proxmox.com:/home/ftp/appliances/
 
 .PHONY: install
-install: country.dat vznet.conf vzdump.conf vzdump-hook-script.pl pve-apt.conf pve-repo-ca-certificates.crt
+install: country.dat vznet.conf vzdump.conf vzdump-hook-script.pl pve-apt.conf pve-repo-ca-certificates.crt mtu
        install -d -m 0700 -o www-data -g www-data ${DESTDIR}/var/log/pveproxy
        install -D -m 0644 debian/pve.logrotate ${DESTDIR}/etc/logrotate.d/pve
        install -d ${DESTDIR}/usr/share/${PACKAGE}
@@ -95,6 +95,7 @@ install: country.dat vznet.conf vzdump.conf vzdump-hook-script.pl pve-apt.conf p
        install -D -m 0644 pve-repo-ca-certificates.crt ${DESTDIR}/etc/apt/pve-repo-ca-certificates.crt
        install -D -m 0644 vzdump.conf ${DESTDIR}/etc/vzdump.conf
        install -D -m 0755 vznet.conf ${DESTDIR}/etc/vz/vznet.conf
+       install -D -m 0755 mtu ${DESTDIR}/etc/network/if-up.d/mtu
        install -m 0644 vzdump-hook-script.pl ${DOCDIR}/examples/vzdump-hook-script.pl
        install -m 0644 copyright ${DOCDIR}
        install -m 0644 debian/changelog.Debian ${DOCDIR}
index 798e71da3b9328b1f431cb4877dedd7deaa2002a..43953c37ab69f150e49f87f762859609235f50ad 100644 (file)
@@ -12,3 +12,4 @@
 /etc/apt/apt.conf.d/75pveconf
 /etc/apt/pve-repo-ca-certificates.crt
 /etc/apt/sources.list.d/pve-enterprise.list
+/etc/network/if-up.d/mtu
diff --git a/mtu b/mtu
new file mode 100755 (executable)
index 0000000..1369f42
--- /dev/null
+++ b/mtu
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+case "$IFACE" in
+  # Ignore any alias (#272891) which uses <interface>:<alabel>
+  *:*)
+    exit 0
+  ;;
+esac
+
+if [ "$METHOD" != manual ]; then
+        exit 0
+fi
+
+if [ -n "$IF_MTU" ]; then
+    ip link set $IFACE mtu $IF_MTU
+fi