summaryrefslogtreecommitdiffstats
path: root/scripts/runqemu-ifup
diff options
context:
space:
mode:
authorAdrian Freihofer <adrian.freihofer@gmail.com>2023-06-22 19:01:23 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-06-24 12:21:48 +0100
commitb97fe9d3e7dce1ee625aa1c1d37d004e93d35ddb (patch)
treef6132dc645aac2d25357d745c3f8c00a3b48ca6e /scripts/runqemu-ifup
parent2401847d7333b1cf1ca5a7ed05a84bfec2f16b67 (diff)
downloadpoky-b97fe9d3e7dce1ee625aa1c1d37d004e93d35ddb.tar.gz
runqemu-ifup: fix tap index
Recent patches changed the index of the tap interfaces. They start now with tap1 instead of tap0. Also the IP address starts with 192.168.7.3 instead of 192.168.7.1. This gets reverted to the previous behavior. (From OE-Core rev: eaf9d2dfd8f0270f543b612fbd2df775adc7a394) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/runqemu-ifup')
-rwxr-xr-xscripts/runqemu-ifup9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/runqemu-ifup b/scripts/runqemu-ifup
index 9820dc535c..fe4492e78b 100755
--- a/scripts/runqemu-ifup
+++ b/scripts/runqemu-ifup
@@ -45,8 +45,13 @@ if [ -z "$OE_TAP_NAME" ]; then
45fi 45fi
46 46
47if taps=$(ip tuntap list 2>/dev/null); then 47if taps=$(ip tuntap list 2>/dev/null); then
48 tap_no=$(( $(echo "$taps" |cut -f 1 -d ":" | sed "s/$OE_TAP_NAME//g" | sort -rn | head -n 1) + 1 )) 48 tap_no_last=$(echo "$taps" |cut -f 1 -d ":" |sed "s/$OE_TAP_NAME//g" | sort -rn | head -n 1)
49 ip tuntap add "$OE_TAP_NAME$tap_no" mode tap group "$GROUP" && TAP="$OE_TAP_NAME$tap_no" 49 if [ -z "$tap_no_last" ]; then
50 tap_no=0
51 else
52 tap_no=$(("$tap_no_last" + 1))
53 fi
54 ip tuntap add "$OE_TAP_NAME$tap_no" mode tap group "$GROUP" && TAP=$OE_TAP_NAME$tap_no
50fi 55fi
51 56
52if [ -z "$TAP" ]; then 57if [ -z "$TAP" ]; then