]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
t_net.sh: delete dummy iface using iproute command
authorAntonio Quartulli <a@unstable.cc>
Thu, 7 Apr 2022 08:15:55 +0000 (10:15 +0200)
committerGert Doering <gert@greenie.muc.de>
Fri, 8 Apr 2022 10:51:36 +0000 (12:51 +0200)
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 <a@unstable.cc>
Acked-by: Gert Doering <gert@greenie.muc.de>
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 <gert@greenie.muc.de>
tests/t_net.sh

index f9dba40404fdf0073f014a9e6e2516cb9aadde43..af78152c7cde6e6d7ad6317c1bb4e9e4f44d0b33 100755 (executable)
@@ -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