ia64/xen-unstable

view tools/hotplug/NetBSD/vif-bridge-nbsd @ 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 415505139333
line source
1 #!/bin/sh -e
3 # $NetBSD: vif-bridge-nbsd,v 1.1.1.1 2008/08/07 20:26:57 cegger Exp $
4 # Called by xenbackendd
5 # Usage: vif-bridge xsdir_backend_path state
7 PATH=/bin:/usr/bin:/sbin:/usr/sbin
8 export PATH
10 xpath=$1
11 xstatus=$2
13 case $xstatus in
14 6)
15 # device removed
16 xenstore-rm $xpath
17 exit 0
18 ;;
19 2)
20 xbridge=$(xenstore-read "$xpath/bridge")
21 xfid=$(xenstore-read "$xpath/frontend-id")
22 xhandle=$(xenstore-read "$xpath/handle")
23 iface=xvif$xfid.$xhandle
24 echo ifconfig $iface up
25 ifconfig $iface up
26 brconfig $xbridge add $iface
27 echo brconfig $xbridge add $iface
28 xenstore-write $xpath/hotplug-status connected
29 echo xenstore-write $xpath/hotplug-status connected
30 exit 0
31 ;;
32 *)
33 exit 0
34 ;;
35 esac