Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Brad Spencer <bspencer@blackberry.com>
To: wireguard@lists.zx2c4.com
Subject: Unexpected error re-initializing Wintun 0.9.2
Date: Thu, 17 Dec 2020 10:07:19 -0400	[thread overview]
Message-ID: <0c6e326e-139c-012b-fb47-95cc85560485@blackberry.com> (raw)

Using Wintun 0.9.2 on Windows 10 Enterprise 1909 x86_64, creating an 
adapter (and then deleting it) works fine.  And, using the API to move 
packets in and out also works fine.  But, if we create an adapter, then 
delete it, and _then_ try to either open or create again in the same 
process, we get an unexpected error.  For example:

 From `WintunOpenAdapter()`:

```
wintun: NamespaceRuntimeInit: Failed to open private namespace: You were 
not connected because a duplicate name exists on the network. If joining 
a domain, go to System in Control Panel to change the computer name and 
try again. If joining a workgroup, choose another workgroup name. (Code 
0x00000034)
wintun: WintunOpenAdapter: Failed to take pool mutex
```

Alternatively, from `WintunCreateAdapter()`:

```
wintun: CreateAdapter: Creating adapter
wintun: NamespaceRuntimeInit: Failed to open private namespace: You were 
not connected because a duplicate name exists on the network. If joining 
a domain, go to System in Control Panel to change the computer name and 
try again. If joining a workgroup, choose another workgroup name. (Code 
0x00000034)
wintun: SelectDriver: Failed to take driver installation mutex
```

If we create and destroy, and then start a new process, we can create 
and destroy again in that process, but only once.  It does not seem to 
matter if we create a session on the first adapter before destroying it 
or if we actually use it or not to move packets.

We have tried sleeping for 10 seconds (and much longer!) between 
iterations and it seems to make no difference.

Are we misusing or misunderstanding the API?  Is this a bug?

We have created a small stand-alone program that demonstrates the bug on 
a freshly installed Windows 10 Enterprise 1909: 
https://github.com/b-spencer/wintun-adapter-error

-- 
Brad Spencer


             reply	other threads:[~2020-12-17 17:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17 14:07 Brad Spencer [this message]
2020-12-17 18:05 ` Jason A. Donenfeld
2020-12-17 18:30   ` Brad Spencer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0c6e326e-139c-012b-fb47-95cc85560485@blackberry.com \
    --to=bspencer@blackberry.com \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).