Development discussion of WireGuard
 help / color / mirror / Atom feed
* Unexpected error re-initializing Wintun 0.9.2
@ 2020-12-17 14:07 Brad Spencer
  2020-12-17 18:05 ` Jason A. Donenfeld
  0 siblings, 1 reply; 3+ messages in thread
From: Brad Spencer @ 2020-12-17 14:07 UTC (permalink / raw)
  To: wireguard

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-17 18:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-17 14:07 Unexpected error re-initializing Wintun 0.9.2 Brad Spencer
2020-12-17 18:05 ` Jason A. Donenfeld
2020-12-17 18:30   ` Brad Spencer

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).