Skip to contentSkip to conversation

Improve error msg when all TAP adapters are in use "or disabled"

PATCH In review Richard Bonhomme 4 participants 4 messages Aug 6, 2020 – Oct 1, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Improve error msg when all TAP adapters are in use "or disabled"

Ref: https://github.com/OpenVPN/openvpn-gui/issues/356

---
 src/openvpn/tun.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/tun.c +1 -1
index cc7b65cf..44ca8450 100644
@@ -6436,7 +6436,7 @@ tun_open_device(struct tuntap *tt, const char *dev_node, const char **device_gui
 
             if (!*device_guid)
             {
-                msg(M_FATAL, "All %s adapters on this system are currently in use.", print_windows_driver(tt->windows_driver));
+                msg(M_FATAL, "All %s adapters on this system are currently in use or disabled.", print_windows_driver(tt->windows_driver));
             }
 
             if (tt->windows_driver != windows_driver)
Signature · 1 line
2.17.1
#1 lore raw

Hi,

This looks good but can we do better? We don't check the error (GetLastError()) after the CreateFile() failure -- can we determine whether the error was due to permissions, busy file (in use) or disabled device and print out a more specific error message? I'm not sure what errors are triggered by CreateFile, so just wondering..

Selva

Quoted 30 lines · Richard Bonhomme

Ref: https://github.com/OpenVPN/openvpn-gui/issues/356

---
 src/openvpn/tun.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/tun.c +1 -2
index cc7b65cf..44ca8450 100644
@@ -6436,7 +6436,7 @@ tun_open_device(struct tuntap *tt, const char *dev_node, const char **device_gui
 
             if (!*device_guid)
             {
-                msg(M_FATAL, "All %s adapters on this system are currently in use.", print_windows_driver(tt->windows_driver));
+                msg(M_FATAL, "All %s adapters on this system are currently in use or disabled.", print_windows_driver(tt->windows_driver));
             }
 
             if (tt->windows_driver != windows_driver)
--

2.17.1

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Acked-by
#2 lore raw

Am 06.08.20 um 21:27 schrieb Selva Nair:

Quoted 7 lines

Hi,

This looks good but can we do better? We don't check the error (GetLastError()) after the CreateFile() failure -- can we determine whether the error was due to permissions, busy file (in use) or disabled device and print out a more specific error message? I'm not sure what errors are triggered by CreateFile, so just wondering..

Since we didn't do better I would suggest we merge the original patch as it is not adding any extra complexity and improves things.

#3 lore raw

[Openvpn-devel] [PATCH applied] Re: Improve error msg when all TAP adapters are in use 'or disabled'

In reply to Richard Bonhomme

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

commit 43cdb0c702dd184541d4fa5e0c2b2899966371a0 (master) commit 25e3145298c1c9e508470a183991957769301a58 (release/2.5)

Author: Richard Bonhomme
Date:   Thu Aug 6 20:01:40 2020 +0100
     Improve error msg when all TAP adapters are in use 'or disabled'

     Signed-off-by: Richard Bonhomme <[email protected]...>
     Acked-by: Arne Schwabe <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg20651.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering