From a3a20a2b095d834e3817173645a0228b257313bd Mon Sep 17 00:00:00 2001 From: Erik Ekman Date: Sat, 21 Mar 2009 12:51:59 +0000 Subject: [PATCH] #53 Support TAP32 version 0901 as well --- CHANGELOG | 1 + README-win32.txt | 2 +- src/tun.c | 6 ++++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 852e2db..b112ede 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -18,6 +18,7 @@ CHANGES: - Increase default interface MTU to 1200. - Fix autoprobing error making every third probe fail, set IP flag Dont-Fragment where supported. Fixes #54. + - Added TAP32 version 0901 as accepted (#53). 2009-01-23: 0.5.0 "iPassed" - Fixed segfault in server when sending version reject. diff --git a/README-win32.txt b/README-win32.txt index e3de50a..1df7f64 100644 --- a/README-win32.txt +++ b/README-win32.txt @@ -49,7 +49,7 @@ cross-compile. == Results of crappy Win32 API: The following fixable limitations apply: - Exactly one TAP32 interface must be installed -- The TAP32 interface must be named "dns" and be version 0801 +- The TAP32 interface must be named "dns" and be version 0801 or 0901 - Server cannot read packet destination address The following (probably) un-fixable limitations apply: diff --git a/src/tun.c b/src/tun.c index d74ec49..57b369d 100644 --- a/src/tun.c +++ b/src/tun.c @@ -38,7 +38,8 @@ struct tun_data data; #define TAP_ADAPTER_KEY "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}" #define TAP_DEVICE_SPACE "\\\\.\\Global\\" -#define TAP_COMPONENT_ID "tap0801" +#define TAP_VERSION_ID_0801 "tap0801" +#define TAP_VERSION_ID_0901 "tap0901" #define KEY_COMPONENT_ID "ComponentId" #define NET_CFG_INST_ID "NetCfgInstanceId" #else @@ -205,7 +206,8 @@ get_device(char *device, int device_len) if (status != ERROR_SUCCESS || datatype != REG_SZ) { goto next; } - if (strncmp(TAP_COMPONENT_ID, component, strlen(TAP_COMPONENT_ID)) == 0) { + if (strncmp(TAP_VERSION_ID_0801, component, strlen(TAP_VERSION_ID_0801)) == 0 || + strncmp(TAP_VERSION_ID_0901, component, strlen(TAP_VERSION_ID_0901)) == 0) { /* We found a TAP32 device, get its NetCfgInstanceId */ char iid_string[256] = NET_CFG_INST_ID;