From: Etienne Dechamps Date: Sun, 15 Mar 2015 18:18:04 +0000 (+0000) Subject: Log TAP-Windows driver version on startup. X-Git-Tag: release-1.1pre12~184^2~1 X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=0f328d9d2853ca723ff3205f39bb22207d21a932;p=tinc Log TAP-Windows driver version on startup. This is generally useful. We've seen issues that are specific to some version of these drivers (especially the newer 9.0.0.21 version), so it's relevant to log it, especially since that means it will be copy-pasted by people posting their logs asking for help. --- diff --git a/src/mingw/device.c b/src/mingw/device.c index 19719a7a..253b95d1 100644 --- a/src/mingw/device.c +++ b/src/mingw/device.c @@ -175,6 +175,17 @@ static bool setup_device(void) { return false; } + /* Get version information from tap device */ + + { + ULONG info[3] = {0}; + DWORD len; + if(!DeviceIoControl(device_handle, TAP_IOCTL_GET_VERSION, &info, sizeof info, &info, sizeof info, &len, NULL)) + logger(DEBUG_ALWAYS, LOG_WARNING, "Could not get version information from Windows tap device %s (%s): %s", device, iface, winerror(GetLastError())); + else + logger(DEBUG_ALWAYS, LOG_INFO, "TAP-Windows driver version: %lu.%lu%s", info[0], info[1], info[2] ? " (DEBUG)" : ""); + } + /* Get MAC address from tap device */ if(!DeviceIoControl(device_handle, TAP_IOCTL_GET_MAC, mymac.x, sizeof mymac.x, mymac.x, sizeof mymac.x, &len, 0)) {