summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'os-plugins/plugins')
-rw-r--r--os-plugins/plugins/xen/init-hooks/10-have-nw-modules/xen.sh45
1 files changed, 21 insertions, 24 deletions
diff --git a/os-plugins/plugins/xen/init-hooks/10-have-nw-modules/xen.sh b/os-plugins/plugins/xen/init-hooks/10-have-nw-modules/xen.sh
index 47edd682..321b6a06 100644
--- a/os-plugins/plugins/xen/init-hooks/10-have-nw-modules/xen.sh
+++ b/os-plugins/plugins/xen/init-hooks/10-have-nw-modules/xen.sh
@@ -1,26 +1,23 @@
# configure Xen bridge xenbr0
-xenbr_config () {
- modprobe ${MODPRV} netloop
- local ipls
- local vifnum="0"
- local bridge="xenbr${vifnum}"
- local netdev="eth${vifnum}"
- local pdev="p${netdev}"
- local vdev="veth${vifnum}"
- local vif0="vif0.${vifnum}"
- # fixme: that is the mac address of main ethernet device
- local mac=`ip link show ${netdev} | grep 'link\/ether' | sed -e 's/.*ether \(..:..:..:..:..:..\).*/\1/'`
+modprobe ${MODPRV} netloop
+local ipls
+local vifnum="0"
+local bridge="xenbr${vifnum}"
+local netdev="eth${vifnum}"
+local pdev="p${netdev}"
+local vdev="veth${vifnum}"
+local vif0="vif0.${vifnum}"
+# fixme: that is the mac address of main ethernet device
+local mac=`ip link show ${netdev} | grep 'link\/ether' | sed -e 's/.*ether \(..:..:..:..:..:..\).*/\1/'`
- brctl addbr ${bridge}
- brctl stp ${bridge} off
- brctl setfd ${bridge} 0
- brctl addif ${bridge} ${vif0}
- for ipls in "${netdev} name ${pdev}" "${vdev} name ${netdev}" \
- "${pdev} down arp off" "${pdev} addr fe:ff:ff:ff:ff:ff" \
- "${netdev} addr ${mac} arp on" "${bridge} up" "${vif0} up" \
- "${pdev} up" "${netdev} up"; do
- ip link set ${ipls}
- done
- brctl addif ${bridge} ${pdev}
- exit 0
-}
+brctl addbr ${bridge}
+brctl stp ${bridge} off
+brctl setfd ${bridge} 0
+brctl addif ${bridge} ${vif0}
+for ipls in "${netdev} name ${pdev}" "${vdev} name ${netdev}" \
+ "${pdev} down arp off" "${pdev} addr fe:ff:ff:ff:ff:ff" \
+ "${netdev} addr ${mac} arp on" "${bridge} up" "${vif0} up" \
+ "${pdev} up" "${netdev} up"; do
+ ip link set ${ipls}
+done
+brctl addif ${bridge} ${pdev}