1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 17:19:20 +00:00

runqemu-if*: Rename confusing variable name

The IFCONFIG variable is really the path to ip and hasn't been
ifconfig for a long time. Rename the variable to something less
confusing.

(From OE-Core rev: eb1c947a056f3e2c80e46e5e606423e85da46caa)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2023-06-15 17:58:30 +01:00
parent 609fc15718
commit 7b87f203c2
2 changed files with 14 additions and 14 deletions
+6 -6
View File
@@ -37,14 +37,14 @@ if !ip tuntap del $TAP mode tap 2>/dev/null; then
exit 1 exit 1
fi fi
IFCONFIG=`which ip 2> /dev/null` IPTOOL=`which ip 2> /dev/null`
if [ "x$IFCONFIG" = "x" ]; then if [ "x$IPTOOL" = "x" ]; then
# better than nothing... # better than nothing...
IFCONFIG=/sbin/ip IPTOOL=/sbin/ip
fi fi
if [ -x "$IFCONFIG" ]; then if [ -x "$IPTOOL" ]; then
if `$IFCONFIG link show $TAP > /dev/null 2>&1`; then if `$IPTOOL link show $TAP > /dev/null 2>&1`; then
$IFCONFIG link del $TAP $IPTOOL link del $TAP
fi fi
fi fi
# cleanup the remaining iptables rules # cleanup the remaining iptables rules
+8 -8
View File
@@ -47,13 +47,13 @@ if [ -z $TAP ]; then
exit 1 exit 1
fi fi
IFCONFIG=`which ip 2> /dev/null` IPTOOL=`which ip 2> /dev/null`
if [ "x$IFCONFIG" = "x" ]; then if [ "x$IPTOOL" = "x" ]; then
# better than nothing... # better than nothing...
IFCONFIG=/sbin/ip IPTOOL=/sbin/ip
fi fi
if [ ! -x "$IFCONFIG" ]; then if [ ! -x "$IPTOOL" ]; then
echo "$IFCONFIG cannot be executed" echo "$IPTOOL cannot be executed"
exit 1 exit 1
fi fi
@@ -67,13 +67,13 @@ if [ ! -x "$IPTABLES" ]; then
fi fi
n=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ] n=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ]
$IFCONFIG addr add 192.168.7.$n/32 broadcast 192.168.7.255 dev $TAP $IPTOOL addr add 192.168.7.$n/32 broadcast 192.168.7.255 dev $TAP
STATUS=$? STATUS=$?
if [ $STATUS -ne 0 ]; then if [ $STATUS -ne 0 ]; then
echo "Failed to set up IP addressing on $TAP" echo "Failed to set up IP addressing on $TAP"
exit 1 exit 1
fi fi
$IFCONFIG link set dev $TAP up $IPTOOL link set dev $TAP up
STATUS=$? STATUS=$?
if [ $STATUS -ne 0 ]; then if [ $STATUS -ne 0 ]; then
echo "Failed to bring up $TAP" echo "Failed to bring up $TAP"
@@ -81,7 +81,7 @@ if [ $STATUS -ne 0 ]; then
fi fi
dest=$[ (`echo $TAP | sed 's/tap//'` * 2) + 2 ] dest=$[ (`echo $TAP | sed 's/tap//'` * 2) + 2 ]
$IFCONFIG route add to 192.168.7.$dest dev $TAP $IPTOOL route add to 192.168.7.$dest dev $TAP
STATUS=$? STATUS=$?
if [ $STATUS -ne 0 ]; then if [ $STATUS -ne 0 ]; then
echo "Failed to add route to 192.168.7.$dest using $TAP" echo "Failed to add route to 192.168.7.$dest using $TAP"