summaryrefslogtreecommitdiff
blob: 31ccf6588e9a6dadbca9114e9cfb5f65209ebb95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Index: xen-3.1.0-src/tools/examples/network-bridge
===================================================================
--- xen-3.1.0-src.orig/tools/examples/network-bridge
+++ xen-3.1.0-src/tools/examples/network-bridge
@@ -70,13 +70,13 @@ vdev="veth${vifnum}"
 vif0="vif0.${vifnum}"
 
 get_ip_info() {
-    addr_pfx=`ip addr show dev $1 | egrep '^ *inet' | sed -e 's/ *inet //' -e 's/ .*//'`
+    addr_pfx=`ip addr show dev $1 | egrep '^ *inet' | sed -e 's/ *inet //' -e "s/$1//"`
     gateway=`ip route show dev $1 | fgrep default | sed 's/default via //'`
 }
     
 do_ifup() {
     if ! ifup $1 ; then
-        if [ ${addr_pfx} ] ; then
+        if [ "${addr_pfx}" ] ; then
             # use the info from get_ip_info()
             ip addr flush $1
             ip addr add ${addr_pfx} dev $1