Skip to content

Commit

Permalink
Fix DeviceIoControl() calls to make NDIS6 TAP-Windows driver happy
Browse files Browse the repository at this point in the history
All calls appear to need both input and output buffers.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Aug 21, 2014
1 parent 3e7c5f8 commit c499aec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tun-win32.c
Expand Up @@ -176,7 +176,8 @@ static intptr_t open_tun(struct openconnect_info *vpninfo, char *guid, char *nam
vpn_progress(vpninfo, PRG_DEBUG, _("Opened tun device %s\n"), name);

if (!DeviceIoControl(tun_fh, TAP_IOCTL_GET_VERSION,
NULL, 0, data, sizeof(data), &len, NULL)) {
data, sizeof(&data), data, sizeof(data),
&len, NULL)) {
DWORD err = GetLastError();

vpn_progress(vpninfo, PRG_ERR,
Expand All @@ -197,7 +198,8 @@ static intptr_t open_tun(struct openconnect_info *vpninfo, char *guid, char *nam
data[1] = data[0] & data[2];

if (!DeviceIoControl(tun_fh, TAP_IOCTL_CONFIG_TUN,
data, sizeof(data), NULL, 0, &len, NULL)) {
data, sizeof(data), data, sizeof(data),
&len, NULL)) {
DWORD err = GetLastError();

vpn_progress(vpninfo, PRG_ERR,
Expand All @@ -207,7 +209,8 @@ static intptr_t open_tun(struct openconnect_info *vpninfo, char *guid, char *nam

data[0] = 1;
if (!DeviceIoControl(tun_fh, TAP_IOCTL_SET_MEDIA_STATUS,
data, sizeof(data[0]), NULL, 0, &len, NULL)) {
data, sizeof(data[0]), data, sizeof(data[0]),
&len, NULL)) {
DWORD err = GetLastError();

vpn_progress(vpninfo, PRG_ERR,
Expand Down
1 change: 1 addition & 0 deletions www/changelog.xml
Expand Up @@ -15,6 +15,7 @@
<ul>
<li><b>OpenConnect HEAD</b>
<ul>
<li>Support new NDIS6 TAP-Windows driver shipped with OpenVPN 2.3.4.</li>
<li>Support using PSKC <i>(<a href="http://tools.ietf.org/html/rfc6030">RFC6030</a>)</i> token files for HOTP/TOTP tokens.</li>
<li>Support for updating HOTP token storage when token is used.</li>
<li>Support for reading OTP token data from a file.</li>
Expand Down

0 comments on commit c499aec

Please sign in to comment.