summaryrefslogtreecommitdiffstats
path: root/scripts/runqemu-ifup
diff options
context:
space:
mode:
authorLaurentiu Palcu <laurentiu.palcu@intel.com>2013-05-21 10:38:40 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-24 14:14:43 +0100
commit4462df6a515300c37370c18772bdbbe1c4cf1c17 (patch)
treede8f1c61cae2713a63e83dde2879fb1425d22baa /scripts/runqemu-ifup
parent40bc4ed3e5a059e1a989a54fc664385d12862e48 (diff)
downloadast2050-yocto-poky-4462df6a515300c37370c18772bdbbe1c4cf1c17.zip
ast2050-yocto-poky-4462df6a515300c37370c18772bdbbe1c4cf1c17.tar.gz
runqemu: fix networking issues
After switching from ifconfig to ip, networking stopped working. This commit contains the following fixes: * set a decent broadcast address for the tap device; * bring up the device; * add the route using ip tool instead of the old route tool; (From OE-Core rev: a286514e2311f52b54d3571dbac6d34aff39e591) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/runqemu-ifup')
-rwxr-xr-xscripts/runqemu-ifup15
1 files changed, 3 insertions, 12 deletions
diff --git a/scripts/runqemu-ifup b/scripts/runqemu-ifup
index 8948153..5f6a437 100755
--- a/scripts/runqemu-ifup
+++ b/scripts/runqemu-ifup
@@ -80,16 +80,6 @@ if [ ! -x "$IFCONFIG" ]; then
exit 1
fi
-ROUTE=`which route`
-if [ "x$ROUTE" = "x" ]; then
- # better than nothing...
- ROUTE=/sbin/route
-fi
-if [ ! -x "$ROUTE" ]; then
- echo "$ROUTE cannot be executed"
- exit 1
-fi
-
IPTABLES=`which iptables 2> /dev/null`
if [ "x$IPTABLES" = "x" ]; then
IPTABLES=/sbin/iptables
@@ -100,10 +90,11 @@ if [ ! -x "$IPTABLES" ]; then
fi
n=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ]
-$IFCONFIG addr add 192.168.7.$n/32 dev $TAP
+$IFCONFIG addr add 192.168.7.$n/32 broadcast 192.168.7.255 dev $TAP
+$IFCONFIG link set dev $TAP up
dest=$[ (`echo $TAP | sed 's/tap//'` * 2) + 2 ]
-$ROUTE add -host 192.168.7.$dest $TAP
+$IFCONFIG route add to 192.168.7.$dest dev $TAP
# setup NAT for tap0 interface to have internet access in QEMU
$IPTABLES -A POSTROUTING -t nat -j MASQUERADE -s 192.168.7.$n/32
OpenPOWER on IntegriCloud