Skip to contentSkip to conversation

minor tweak to keep network-bridge working in busybox environment

PATCH Applied David Lively 2 participants 2 messages May 19, 2006 – May 20, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 minor tweak to keep network-bridge working in busybox environment

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.

tools/examples/network-bridge +1 -1
diff -r aa17b7173325 tools/examples/network-bridge
@@ -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
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 7 lines · David Lively

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.)

Applied. Thanks.

christian