]> code.ossystems Code Review - openembedded-core.git/commitdiff
poky-qemu-ifup: allow multiple tap devices
authorJeff Dike <jdike@x86_64.user-mode-linux.org>
Wed, 4 Aug 2010 21:19:59 +0000 (17:19 -0400)
committerRichard Purdie <rpurdie@linux.intel.com>
Fri, 20 Aug 2010 15:20:09 +0000 (16:20 +0100)
This patch bases the tap IP address on the device number, providing
each device with its own IP address.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
scripts/poky-qemu-ifup

index e7f689d2517f90da9ca179219957b65f8a3a18e4..3b2ed7c04ad341656da809ddbf3e44f43a58f445 100755 (executable)
@@ -30,7 +30,8 @@ if [ "x$IFCONFIG" = "x" ]; then
     IFCONFIG=/sbin/ifconfig
 fi
 
-$IFCONFIG $TAP 192.168.7.1
+n=$[ `echo $TAP | sed 's/tap//'` + 1 ]
+$IFCONFIG $TAP 192.168.7.$n
 
 # setup NAT for tap0 interface to have internet access in QEMU
 IPTABLES=`which iptables`