fix network-bridge stop
PATCH 1/1 fix network-bridge stop
During my attempts to get the latest bridge networking model working on my system, I often invoked 'network-bridge stop' with total failure. Attached is an updated version that works.
-Andrew
tools/examples/network-bridge +17 -13
@@ -222,20 +222,24 @@ op_stop () { return fi - brctl delif ${bridge} ${netdev} + if ifconfig peth0 2>/dev/null | grep -q peth0 ; then + + ifconfig vif0.0 down + mac=`ifconfig eth0 | grep HWadd | \ + sed -e 's/.*\(..:..:..:..:..:..\).*/\1/'` + ifconfig ${netdev} 0.0.0.0 down + ifconfig ${netdev} hw ether fe:ff:ff:ff:ff:ff + + ifconfig p${netdev} down + ifconfig p${netdev} hw ether ${mac} arp + brctl delif ${bridge} p${netdev} + + ip link set eth0 name veth0 + ip link set peth0 name eth0 + ifconfig ${bridge} down + brctl delbr ${bridge} + ifup eth0 - if ifconfig veth0 2>/dev/null | grep -q veth0 ; then - brctl delif ${bridge} vif0.0 - ifconfig vif0.0 down - mac=`ifconfig veth0 | grep HWadd | sed -e 's/.*\(..:..:..:..:..:..\).*/\1/'` - ifconfig ${netdev} down - ifconfig ${netdev} hw ether ${mac} - ifconfig ${netdev} arp up - transfer_addrs veth0 ${netdev} - transfer_routes veth0 ${netdev} - del_addrs veth0 - ifconfig veth0 -arp down - ifconfig veth0 hw ether 00:00:00:00:00:00 else transfer_routes ${bridge} ${netdev} fi
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 3 lines · Andrew Theurer
During my attempts to get the latest bridge networking model working on my system, I often invoked 'network-bridge stop' with total failure. Attached is an updated version that works.
Just to clarify: presumably the problem with the current script, that your patch fixes, is that it tests for and tears down veth0, when in fact veth0 has been renamed to eth0, and eth0 to peth0? :-)
-- Keir
Quoted 9 lines · Keir Fraser
Quoted 3 lines · Andrew Theurer
During my attempts to get the latest bridge networking model working on my system, I often invoked 'network-bridge stop' with total failure. Attached is an updated version that works.
Just to clarify: presumably the problem with the current script, that your patch fixes, is that it tests for and tears down veth0, when in fact veth0 has been renamed to eth0, and eth0 to peth0? :-)
Yes, the script in current xen-unstable, when running "stop", tests for veth0, which does not exist because it has been renamed to eth0. It now tests for peth0, since that is the only real indication that veth0 was used in the first place. There are other small fixes like removal or hard coded "peth0", removal of unconditional 'brctl delif xen-br0 eth0', and reversal of ethernet naming.
-Andrew