summaryrefslogtreecommitdiffstats
path: root/scripts/runqemu-ifdown
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2018-06-07 07:52:47 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-06-18 10:07:58 (GMT)
commit559f4951e2ec786a05e39a685299d4913a28056e (patch)
tree284141f60c325e881c8801de0be8aeb91eff6d10 /scripts/runqemu-ifdown
parent27061a274f47c72a2290182f7b1da6d6ec309fc7 (diff)
downloadpoky-559f4951e2ec786a05e39a685299d4913a28056e.tar.gz
runqemu-ifdown: ensure to clean up TAP
In runqemu-ifup, ip command is used to add TAP; in runqemu-ifdown, we should do the reversed logic, using ip command to delete TAP, to make sure TAP is cleaned up by ourselves. I can see that in runqemu-ifdown script, 'tunctl -d' and 'iptables' commands are used to deal with TAP, but these two commands cannot make sure that the TAP is cleaned up. runqemu-ifup uses 'ip' to set up TAP, we really need to do the opposite in runqemu-ifdown. (From OE-Core rev: 322e41de7f4fb21315bf75f1038314c31ac4754b) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/runqemu-ifdown')
-rwxr-xr-xscripts/runqemu-ifdown10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/runqemu-ifdown b/scripts/runqemu-ifdown
index ffbc9de..2486968 100755
--- a/scripts/runqemu-ifdown
+++ b/scripts/runqemu-ifdown
@@ -51,6 +51,16 @@ fi
51 51
52$TUNCTL -d $TAP 52$TUNCTL -d $TAP
53 53
54IFCONFIG=`which ip 2> /dev/null`
55if [ "x$IFCONFIG" = "x" ]; then
56 # better than nothing...
57 IFCONFIG=/sbin/ip
58fi
59if [ -x "$IFCONFIG" ]; then
60 if `$IFCONFIG link show $TAP > /dev/null 2>&1`; then
61 $IFCONFIG link del $TAP
62 fi
63fi
54# cleanup the remaining iptables rules 64# cleanup the remaining iptables rules
55IPTABLES=`which iptables 2> /dev/null` 65IPTABLES=`which iptables 2> /dev/null`
56if [ "x$IPTABLES" = "x" ]; then 66if [ "x$IPTABLES" = "x" ]; then