ia64/xen-unstable

changeset 6839:c9c49385c26e

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.

Signed-off-by: Andrew Theurer <habanero@us.ibm.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Sep 14 16:49:23 2005 +0000 (2005-09-14)
parents 481a4ce27c15
children 810039218827
files tools/examples/network-bridge
line diff
     1.1 --- a/tools/examples/network-bridge	Wed Sep 14 15:56:06 2005 +0000
     1.2 +++ b/tools/examples/network-bridge	Wed Sep 14 16:49:23 2005 +0000
     1.3 @@ -222,27 +222,31 @@ op_stop () {
     1.4          return
     1.5      fi
     1.6  
     1.7 -    brctl delif ${bridge} ${netdev}
     1.8 +    if ifconfig peth0 2>/dev/null | grep -q peth0 ; then
     1.9  
    1.10 -    if ifconfig veth0 2>/dev/null | grep -q veth0 ; then
    1.11 -        brctl delif ${bridge} vif0.0
    1.12          ifconfig vif0.0 down
    1.13 -        mac=`ifconfig veth0 | grep HWadd | sed -e 's/.*\(..:..:..:..:..:..\).*/\1/'`
    1.14 -        ifconfig ${netdev} down
    1.15 -        ifconfig ${netdev} hw ether ${mac}
    1.16 -        ifconfig ${netdev} arp up
    1.17 -        transfer_addrs veth0 ${netdev}
    1.18 -        transfer_routes veth0 ${netdev}
    1.19 -        del_addrs veth0
    1.20 -        ifconfig veth0 -arp down
    1.21 -        ifconfig veth0 hw ether 00:00:00:00:00:00
    1.22 +        mac=`ifconfig eth0 | grep HWadd | \
    1.23 +            sed -e 's/.*\(..:..:..:..:..:..\).*/\1/'`
    1.24 +        ifconfig ${netdev} 0.0.0.0 down
    1.25 +        ifconfig ${netdev} hw ether fe:ff:ff:ff:ff:ff
    1.26 +
    1.27 +        ifconfig p${netdev} down
    1.28 +        ifconfig p${netdev} hw ether ${mac} arp 
    1.29 +        brctl delif ${bridge} p${netdev}
    1.30 +
    1.31 +        ip link set eth0 name veth0
    1.32 +        ip link set peth0 name eth0
    1.33 +        ifconfig ${bridge} down
    1.34 +        brctl delbr ${bridge}
    1.35 +        ifup eth0
    1.36 +
    1.37      else
    1.38          transfer_routes ${bridge} ${netdev}
    1.39      fi
    1.40  }
    1.41  
    1.42  case ${OP} in
    1.43 -  start)
    1.44 +    start)
    1.45          op_start
    1.46          ;;
    1.47