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-changelog

[Xen-changelog] Fix code which finds the default interface if there are

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix code which finds the default interface if there are static routes.
From: Xen staging patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 08 May 2006 13:58:09 +0000
Delivery-date: Mon, 08 May 2006 07:02:56 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID 32444375fd3da0ddaba3b321e352a33f79d912ea
# Parent  1d2a0e2ef8f79b68bc4ca017a4d22c25b06dd51c
Fix code which finds the default interface if there are static routes.
The current code will break if there are multiple scope global routes
since the "ip route list default" command doesn't use "default" as a
filter, and will output multiple devices which breaks the rest of the
script.
Also make the vif/xenbr/eth naming consistent, i.e. if your default
network interface is eth1, you get vif1 and xenbr1.

Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>
---
 tools/examples/network-bridge |    3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)

diff -r 1d2a0e2ef8f7 -r 32444375fd3d tools/examples/network-bridge
--- a/tools/examples/network-bridge     Sun May 07 21:41:36 2006 +0100
+++ b/tools/examples/network-bridge     Mon May 08 10:36:13 2006 +0100
@@ -59,9 +59,8 @@ findCommand "$@"
 findCommand "$@"
 evalVariables "$@"
 
-vifnum=${vifnum:-0}
+vifnum=${vifnum:-$(ip route list | awk '/^default / { sub(/eth/,"",$NF); print 
$NF }')}
 bridge=${bridge:-xenbr${vifnum}}
-netdev=${netdev:-$(ip route list default scope global| awk '{ print $NF }')}
 netdev=${netdev:-eth${vifnum}}
 antispoof=${antispoof:-no}
 

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

<Prev in Thread] Current Thread [Next in Thread>