When no TUN/TAP driver is installed a interface cannot be created. This
patch detects this condition and bails out with an error message.

This also fixes a typo in one of the error messages.
---
 src/tapctl/tap.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/tapctl/tap.c b/src/tapctl/tap.c
index 790a4956..ed3c6e0b 100644
--- a/src/tapctl/tap.c
+++ b/src/tapctl/tap.c
@@ -460,7 +460,7 @@ tap_create_interface(
             &devinfo_data))
     {
         dwResult = GetLastError();
-        msg(M_NONFATAL, "%s: SetupDiClassNameFromGuid failed", __FUNCTION__);
+        msg(M_NONFATAL, "%s: SetupDiCreateDeviceInfo failed", __FUNCTION__);
         goto cleanup_hDevInfoList;
     }
 
@@ -596,6 +596,13 @@ tap_create_interface(
         free(drvinfo_detail_data);
     }
 
+    if (dwlDriverVersion == 0)
+    {
+        dwResult = ERROR_NOT_FOUND;
+        msg(M_NONFATAL, "%s: No driver for device \"%" PRIsLPTSTR "\" 
installed.", __FUNCTION__, szzHardwareIDs);
+        goto cleanup_DriverInfoList;
+    }
+
     /* Call appropriate class installer. */
     if (!SetupDiCallClassInstaller(
             DIF_REGISTERDEVICE,
-- 
2.19.0.windows.1



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

Reply via email to