]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts/poky-qemu-ifup: Ensure the host has a route to it
authorRichard Purdie <rpurdie@linux.intel.com>
Fri, 10 Sep 2010 09:43:06 +0000 (10:43 +0100)
committerRichard Purdie <rpurdie@linux.intel.com>
Fri, 10 Sep 2010 09:45:55 +0000 (10:45 +0100)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
scripts/poky-qemu-ifup

index e248a27106cf19ec6da85b6612bff7ab231d616b..5ae6c6aefba2e538eb9d517568198555416b73b6 100755 (executable)
@@ -92,9 +92,18 @@ if [ "x$IFCONFIG" = "x" ]; then
        IFCONFIG=/sbin/ifconfig
 fi
 
+ROUTE=`which route`
+if [ "x$ROUTE" = "x" ]; then
+       # better than nothing...
+       ROUTE=/sbin/route
+fi
+
 n=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ]
 $IFCONFIG $TAP 192.168.7.$n
 
+dest=$[ (`echo $TAP | sed 's/tap//'` * 2) + 2 ]
+$ROUTE add -host 192.168.7.$dest $TAP
+
 # setup NAT for tap0 interface to have internet access in QEMU
 IPTABLES=`which iptables`
 if [ "x$IPTABLES" = "x" ]; then