diff options
author | Charles Arnold <carnold@suse.com> | 2013-09-16 14:18:37 -0600 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2013-09-17 15:26:27 +0100 |
commit | f3f5f1927f0d3aef9e3d2ce554dbfa0de73487d5 (patch) | |
tree | 78433477ca2964ec5c571e65b2aa98a39ece336a | |
parent | c5e9596cd095e3b96a090002d9e6629a980904eb (diff) | |
download | xen-f3f5f1927f0d3aef9e3d2ce554dbfa0de73487d5.tar.gz xen-f3f5f1927f0d3aef9e3d2ce554dbfa0de73487d5.tar.bz2 xen-f3f5f1927f0d3aef9e3d2ce554dbfa0de73487d5.zip |
tools/hotplug: set mtu from bridge for tap interface
With changeset 22885 support was added for setting the MTU in the vif-bridge
script for when a vif interface was set to 'online'. The was not done for the
'add' operation. The 'add' operation was added to the script for when tap
devices were specified (c/s 21944). With the setting of the MTU for the
'online' case was there a reason for omitting the 'add'?
This patch sets the MTU for both 'online' and 'add' in the vif-bridge script.
Signed-off-by: Charles Arnold <carnold@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
-rw-r--r-- | tools/hotplug/Linux/vif-bridge | 7 | ||||
-rw-r--r-- | tools/hotplug/Linux/xen-network-common.sh | 10 |
2 files changed, 12 insertions, 5 deletions
diff --git a/tools/hotplug/Linux/vif-bridge b/tools/hotplug/Linux/vif-bridge index 9a6f82a716..678262d004 100644 --- a/tools/hotplug/Linux/vif-bridge +++ b/tools/hotplug/Linux/vif-bridge @@ -81,11 +81,7 @@ fi case "$command" in online) setup_virtual_bridge_port "$dev" - mtu="`ip link show $bridge | awk '/mtu/ { print $5 }'`" - if [ -n "$mtu" ] && [ "$mtu" -gt 0 ] - then - ip link set $dev mtu $mtu || : - fi + set_mtu $bridge $dev add_to_bridge "$bridge" "$dev" ;; @@ -96,6 +92,7 @@ case "$command" in add) setup_virtual_bridge_port "$dev" + set_mtu $bridge $dev add_to_bridge "$bridge" "$dev" ;; esac diff --git a/tools/hotplug/Linux/xen-network-common.sh b/tools/hotplug/Linux/xen-network-common.sh index 8cff156d29..50b8711cca 100644 --- a/tools/hotplug/Linux/xen-network-common.sh +++ b/tools/hotplug/Linux/xen-network-common.sh @@ -132,3 +132,13 @@ add_to_bridge () { ip link set ${dev} up } +# Usage: set_mtu bridge dev +set_mtu () { + local bridge=$1 + local dev=$2 + mtu="`ip link show ${bridge}| awk '/mtu/ { print $5 }'`" + if [ -n "$mtu" ] && [ "$mtu" -gt 0 ] + then + ip link set ${dev} mtu $mtu || : + fi +} |