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>
---
 tests/t_net.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/t_net.sh b/tests/t_net.sh
index f9dba404..af78152c 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
-- 
2.35.1



_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to