[Openvpn-devel] t_net.sh: delete dummy iface using iproute command

Message ID 20220407081555.25228-1-a@unstable.cc
State Accepted
Headers show
Series [Openvpn-devel] t_net.sh: delete dummy iface using iproute command | expand

Commit Message

Antonio Quartulli April 6, 2022, 10:15 p.m. UTC
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(-)

Comments

Gert Doering April 8, 2022, 1:42 a.m. UTC | #1
Acked-by: Gert Doering <gert@greenie.muc.de>

Indeed, now t_net.sh properly cleans up behind itself :-) - thanks.

Your patch has been applied to the master and release/2.5 branch.

commit 976e6caf0e161d3c787e1378cec44608c17b292a (master)
commit c3f4419cd37faaf4f2960d911a1008a161b82561 (release/2.5)
Author: Antonio Quartulli
Date:   Thu Apr 7 10:15:55 2022 +0200

     t_net.sh: delete dummy iface using iproute command

     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>


--
kind regards,

Gert Doering

Patch

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