WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] tools: Fix network-bridge to work with Gentoo

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] tools: Fix network-bridge to work with Gentoo
From: Jon Mason <jdmason@xxxxxxxxxx>
Date: Thu, 29 Sep 2005 17:20:41 -0500
Delivery-date: Thu, 29 Sep 2005 22:19:03 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.8i
This patch fixes domU networking in Gentoo.  The change to ifup/ifdown
(which isn't availabe in Gentoo) prevents the bridge from being setup
correctly.  The patch below checks if ifup is avaiable, and if not
starts the Gentoo networking scripts.  

Signed-off-by: Jon Mason <jdmason@xxxxxxxxxx>

# HG changeset patch
# User root@pentium4
# Node ID 07ba15ba986268ff869d7d2253eab8eed3edbe8b
# Parent  f529cd119470032c2bc70b21432e733f9605727b
Fix network-bridge to work with Gentoo

diff -r f529cd119470 -r 07ba15ba9862 tools/examples/network-bridge
--- a/tools/examples/network-bridge     Thu Sep 29 17:28:28 2005
+++ b/tools/examples/network-bridge     Thu Sep 29 22:03:46 2005
@@ -177,7 +177,12 @@
 
     if ifconfig veth0 2>/dev/null | grep -q veth0 ; then
        mac=`ifconfig ${netdev} | grep HWadd | sed -e 
's/.*\(..:..:..:..:..:..\).*/\1/'`
-       if ! ifdown ${netdev} ; then
+       if which ifdown 2> /dev/null ; then
+               ifdown ${netdev} 2> RC=$?
+       else
+               /etc/init.d/net.${netdev} stop 2> RC=$? 
+       fi
+       if ! $RC ; then
                # if ifup didn't work, see if we have an ip= on cmd line
                if egrep 'ip=[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:' /proc/cmdline ; 
                then
@@ -197,7 +202,12 @@
        ip link set ${bridge} up
        ip link set vif0.0 up
        ip link set p${netdev} up
-       if ! ifup ${netdev} ; then
+       if which ifup 2> /dev/null ; then
+               ifup ${netdev} 2> RC=$?
+       else
+               /etc/init.d/net.${netdev} start 2> RC=$? 
+       fi
+       if ! $RC  ; then
                if [ ${kip} ] ; then
                        # use the addresses we grocked from /proc/cmdline       
                        ifconfig ${netdev} ${kip} 
@@ -238,7 +248,7 @@
         ip link set peth0 name eth0
         ifconfig ${bridge} down
         brctl delbr ${bridge}
-        ifup eth0
+        ifup eth0 2>/dev/null || /etc/init.d/net.eth0 start
 
     else
         transfer_routes ${bridge} ${netdev}

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel