diff options
author | Dan Streetman <dan.streetman@canonical.com> | 2016-09-08 12:47:31 -0400 |
---|---|---|
committer | Andrew Shadura <andrew.shadura@collabora.co.uk> | 2017-11-26 10:54:57 +0000 |
commit | b4c7eb84e369d2a56cd3f444d8cc450dc67f04b4 (patch) | |
tree | 1009ba75fa225756339a5a1a38571be345c53a7f | |
parent | 3307aa6f852cd13f9f50a704099b2bf19b6b9439 (diff) |
Increase raw device MTU when needed.
If VLAN is configured with higher MTU than raw device MTU, which can
happen if VLAN is ifup'ed before raw device, then increase raw device
MTU first so the VLAN ifup does not fail. (LP: #1224007)
-rw-r--r-- | debian/changelog | 10 | ||||
-rw-r--r-- | debian/network/if-pre-up.d/vlan | 8 |
2 files changed, 16 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog index fc1c301..e2d0b4c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,16 @@ -vlan (1.9-3.3) UNRELEASED; urgency=low +vlan (1.9-3.3) UNRELEASED; urgency=medium + [ Stéphane Graber ] * Now that a vlan interface can be created by a udev hook and ifupdown checks return codes from the scripts, make sure to properly deal with an already existing interface. - -- Stéphane Graber <stgraber@ubuntu.com> Fri, 20 Jan 2012 19:13:23 -0500 + [ Dan Streetman ] + * If VLAN is configured with higher MTU than raw device MTU, which can + happen if VLAN is ifup'ed before raw device, then increase raw device + MTU first so the VLAN ifup does not fail. (LP: #1224007) + + -- Dan Streetman <dan.streetman@canonical.com> Thu, 08 Sep 2016 12:47:31 -0400 vlan (1.9-3.2) unstable; urgency=medium diff --git a/debian/network/if-pre-up.d/vlan b/debian/network/if-pre-up.d/vlan index 1796988..675d01b 100644 --- a/debian/network/if-pre-up.d/vlan +++ b/debian/network/if-pre-up.d/vlan @@ -49,6 +49,14 @@ case "$IFACE" in ;; esac +if [ -n "$IF_MTU" -a -n "$IF_VLAN_RAW_DEVICE" ]; then + CUR_DEV_MTU=`cat /sys/class/net/$IF_VLAN_RAW_DEVICE/mtu` + # increase the vlan raw device mtu if needed + if [ -n "$CUR_DEV_MTU" ] && [ $CUR_DEV_MTU -lt $IF_MTU ]; then + ip link set dev $IF_VLAN_RAW_DEVICE mtu $IF_MTU + fi +fi + if [ -n "$IF_VLAN_RAW_DEVICE" ] && [ ! -d /sys/class/net/$IFACE ]; then if [ ! -x /sbin/vconfig ]; then exit 0 |