ia64/xen-unstable

diff tools/hotplug/Linux/network-bridge @ 19497:2f6ed9318c03

network-bridge: Fix do_ifup in the case of ${bridge} != ${netdev}

On RHEL5.2, ifup ${bridge} fails if ${bridge} != ${netdev},
because RHEL5.2's ifup ${bridge} runs the following sequence:

1. Search CONFIG that has the same mac address of ${bridge}.=20
ifcfg-${netdev} is found.
2. Run "ip link set dev ${netdev} up".
# ${bridge} is expected.
3. Output "Failed to bring up ${netdev}."
Because ${netdev} does not exist.

Thus, do_ifup() should not use ifup if ${bridge} != ${netdev}.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Apr 02 11:48:10 2009 +0100 (2009-04-02)
parents 4bfc67b09e9c
children cdc044f665dc
line diff
     1.1 --- a/tools/hotplug/Linux/network-bridge	Thu Apr 02 07:53:11 2009 +0100
     1.2 +++ b/tools/hotplug/Linux/network-bridge	Thu Apr 02 11:48:10 2009 +0100
     1.3 @@ -106,7 +106,7 @@ get_ip_info() {
     1.4  }
     1.5      
     1.6  do_ifup() {
     1.7 -    if ! ifup $1 ; then
     1.8 +    if [ $1 != "${netdev}" ] || ! ifup $1 ; then
     1.9          if [ -n "$addr_pfx" ] ; then
    1.10              # use the info from get_ip_info()
    1.11              ip addr flush $1
    1.12 @@ -223,9 +223,9 @@ op_start () {
    1.13  
    1.14      preiftransfer ${netdev}
    1.15      transfer_addrs ${netdev} ${tdev}
    1.16 +    # Remember the IP details for do_ifup.
    1.17 +    get_ip_info ${netdev}
    1.18      if ! ifdown ${netdev}; then
    1.19 -	# If ifdown fails, remember the IP details.
    1.20 -	get_ip_info ${netdev}
    1.21  	ip link set ${netdev} down
    1.22  	ip addr flush ${netdev}
    1.23      fi