From: Antonio Quartulli
Date: Thu, 7 Apr 2022 08:15:55 +0000 (+0200)
Subject: t_net.sh: delete dummy iface using iproute command
X-Git-Tag: v2.5.7~17
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3f4419cd37faaf4f2960d911a1008a161b82561;p=thirdparty%2Fopenvpn.git
t_net.sh: delete dummy iface using iproute command
A dummy interface cannot be deleted using --rmtun because openvpn tries
to send some ioctl (i.e. TUNSETPERSIST) which is not supported by this
device type. This results in the following error:
2022-04-07 09:59:29 Cannot ioctl TUNSETPERSIST(0) ovpn-dummy0: Bad file
descriptor (errno=9)
2022-04-07 09:59:29 Exiting due to fatal error
and the interface is not deleted.
Use iproute to generically delete an interface.
Signed-off-by: Antonio Quartulli
Acked-by: Gert Doering
Message-Id: <20220407081555.25228-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg24086.html
Signed-off-by: Gert Doering
(cherry picked from commit 976e6caf0e161d3c787e1378cec44608c17b292a)
---
diff --git a/tests/t_net.sh b/tests/t_net.sh
index f9dba4040..af78152c7 100755
--- a/tests/t_net.sh
+++ b/tests/t_net.sh
@@ -166,6 +166,6 @@ for i in $(seq 0 $MAX_TEST); do
done
# remove interface for good
-$RUN_SUDO $openvpn --dev $IFACE --dev-type tun --rmtun >/dev/null
+$RUN_SUDO ip link del $IFACE
exit 0