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] minor tweak to keep network-bridge working in busybo

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] minor tweak to keep network-bridge working in busybox environment
From: David Lively <dlively@xxxxxxxxxxxxxxx>
Date: Fri, 19 May 2006 14:02:54 -0400
Delivery-date: Fri, 19 May 2006 11:03:18 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929)
Hi Folks -
 The latest tweak to the network-bridge script doesn't work in a
busybox environment (because the busybox version of 'awk' is a
little too feeble).  The attached patch fixes this, while keeping it
working in a more capable environment.  (It also generalizes the
vifnum extraction slightly - stripping all leading non-numeric chars
from the default ifname.)

Dave

Make the latest network-bridge tweaks work in a busybox environment too.

Signed-off-by: David Lively <dlively@xxxxxxxxxxxxxxx>

diff -r aa17b7173325 tools/examples/network-bridge
--- a/tools/examples/network-bridge     Thu May 18 21:41:56 2006 +0100
+++ b/tools/examples/network-bridge     Fri May 19 14:00:34 2006 -0400
@@ -59,7 +59,7 @@ findCommand "$@"
 findCommand "$@"
 evalVariables "$@"
 
-vifnum=${vifnum:-$(ip route list | awk '/^default / { 
sub(/^(eth|xenbr)/,"",$NF); print $NF }')}
+vifnum=${vifnum:-$(ip route list | awk '/^default / { print $NF }' | sed -r 
's/[^0-9]+//')}
 bridge=${bridge:-xenbr${vifnum}}
 netdev=${netdev:-eth${vifnum}}
 antispoof=${antispoof:-no}
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>