[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] network-bridge: Fix for bonding



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1240395997 -3600
# Node ID cdc044f665dc71ec819d3a0ff8262b235274d8d6
# Parent  6ba4e34d21d33509c5f64b1f8feb95bc4a1577a4
network-bridge: Fix for bonding

If ${netdev} is bonding, brctl addif ${bridge} ${pdev} fails:
  can't add ${pdev} to bridge ${bridge}: Invalid argument
Because ${pdev} has no slaves at this point.=20
# Notice that ifdown ${netdev} clears slaves of ${netdev}.

This patch restores slaves before add_to_bridge2 ${bridge} ${pdev}.

Signed-off-by: KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>
---
 tools/hotplug/Linux/network-bridge |    9 +++++++++
 1 files changed, 9 insertions(+)

diff -r 6ba4e34d21d3 -r cdc044f665dc tools/hotplug/Linux/network-bridge
--- a/tools/hotplug/Linux/network-bridge        Tue Apr 21 16:31:26 2009 +0100
+++ b/tools/hotplug/Linux/network-bridge        Wed Apr 22 11:26:37 2009 +0100
@@ -223,6 +223,10 @@ op_start () {
 
     preiftransfer ${netdev}
     transfer_addrs ${netdev} ${tdev}
+    # Remember slaves for bonding interface.
+    if [ -e /sys/class/net/${netdev}/bonding/slaves ]; then
+       slaves=`cat /sys/class/net/${netdev}/bonding/slaves`
+    fi
     # Remember the IP details for do_ifup.
     get_ip_info ${netdev}
     if ! ifdown ${netdev}; then
@@ -234,6 +238,11 @@ op_start () {
 
     setup_bridge_port ${pdev}
 
+    # Restore slaves
+    if [ -n "${slaves}" ]; then
+       ip link set ${pdev} up
+       ifenslave ${pdev} ${slaves}
+    fi
     add_to_bridge2 ${bridge} ${pdev}
     do_ifup ${bridge}
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.