|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH] network-bridge: Fix for bonding
Hi,
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.
# 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>
--
KUWAMURA Shin'ya
# HG changeset patch
# User KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>
# Date 1240388829 -32400
# Node ID 7c8bdef80b3175a36ebfe11dab70d5a8b4faea5f
# Parent 655dc3bc1d8ee15465f9ce14a1dc23f1f01c639a
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.
# 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>
diff -r 655dc3bc1d8e -r 7c8bdef80b31 tools/hotplug/Linux/network-bridge
--- a/tools/hotplug/Linux/network-bridge Thu Apr 16 11:54:06 2009 +0100
+++ b/tools/hotplug/Linux/network-bridge Wed Apr 22 17:27:09 2009 +0900
@@ -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-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread> |
- [Xen-devel] [PATCH] network-bridge: Fix for bonding,
KUWAMURA Shin'ya <=
|
|
|
|
|