From: Andrew Theurer Subject: [PATCH] fix network-bridge stop Date: Wed, 14 Sep 2005 10:51:57 -0500 Message-ID: <200509141051.57727.habanero@us.ibm.com> Reply-To: habanero@us.ibm.com Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_dcEKDT/s6qUM09y" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org --Boundary-00=_dcEKDT/s6qUM09y Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 signed-off-by: Andrew Theurer --Boundary-00=_dcEKDT/s6qUM09y Content-Type: text/x-diff; charset="us-ascii"; name="network-bridge.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="network-bridge.patch" diff -Naurp xen-unstable.hg-before/tools/examples/network-bridge xen-unstable.hg-after/tools/examples/network-bridge --- xen-unstable.hg-before/tools/examples/network-bridge 2005-09-14 09:43:44.000000000 -0500 +++ xen-unstable.hg-after/tools/examples/network-bridge 2005-09-14 10:09:12.000000000 -0500 @@ -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 --Boundary-00=_dcEKDT/s6qUM09y Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_dcEKDT/s6qUM09y--