Skip to contentSkip to conversation

2.0-beta15 on WinXP: CreateFile failed on TAP device

Openvpn-devel Mathias Sundman 2 participants 4 messages Nov 2, 2004 – Nov 3, 2004

lore
Share & tools
lore
#0 lore raw

James,

I think we made a little misstake with the "auto-find free TAP device" feature.

In OpenVPN GUI >= beta20 I close the connections and restart them after a suspend. If multiple connections were running this means that they will all be re-started at the exact same time after the suspend.

I suppose the same thing happends when you start the service wrapper.

Anyway, I had two connections running, and after a suspend, one of the connections started fine, but the other one failed with the following message:

CreateFile failed on TAP device: \\.\Global\{75E5A03B-F1A9-422E-8DBA-EFF4B55C1B07}.tap:
General failure (ERROR_GEN_FAILURE) (errno=31)

which is the same interface as the first connection used.

I havn't checked the code yet, but I suspect that you changed the code to search for a free adapter when openvpn is started, but not actually open it until later.

Both processes seemed to find the same interface free, but later one of them of cource failed to open it.

/Mathias

--
_____________________________________________________________

Mathias Sundman                  (^)   ASCII Ribbon Campaign
OpenVPN GUI for Windows           X    NO HTML/RTF in e-mail
http://www.nilings.se/openvpn    / \   NO Word docs in e-mail
#1 lore raw
Quoted 10 lines · Mathias Sundman

James,

I think we made a little misstake with the "auto-find free TAP device" feature.

In OpenVPN GUI >= beta20 I close the connections and restart them after a suspend. If multiple connections were running this means that they will all be re-started at the exact same time after the suspend.

I suppose the same thing happends when you start the service wrapper.

Anyway, I had two connections running, and after a suspend, one of the connections started fine, but the other one failed with the following message:

Quoted 8 lines

CreateFile failed on TAP device: \\.\Global\{75E5A03B-F1A9-422E-8DBA-EFF4B55C1B07}.tap:
General failure (ERROR_GEN_FAILURE) (errno=31)

which is the same interface as the first connection used.

I havn't checked the code yet, but I suspect that you changed the code to search for a free adapter when openvpn is started, but not actually open it until later.

Both processes seemed to find the same interface free, but later one of them of cource failed to open it.

Forget it!!

My mistake. I'm testing far to many things at the same time now :-) I had simply specified a dev-node in one of the configs because I had todo some testing with OpenVPN 2.0-beta11 earlier and forgot to change it back.

I should of cource have checked my configs carefuly before posting... Sorry.

/Mathias

#3 lore raw
In reply to Mathias Sundman
Quoted 19 lines · Mathias Sundman

James,

I think we made a little misstake with the "auto-find free TAP device" feature.

In OpenVPN GUI >= beta20 I close the connections and restart them after a suspend. If multiple connections were running this means that they will all be re-started at the exact same time after the suspend.

I suppose the same thing happends when you start the service wrapper.

Anyway, I had two connections running, and after a suspend, one of the connections started fine, but the other one failed with the following message:

CreateFile failed on TAP device:
\\.\Global\{75E5A03B-F1A9-422E-8DBA-EFF4B55C1B07}.tap:
General failure (ERROR_GEN_FAILURE) (errno=31)

Quoted 5 lines

which is the same interface as the first connection used.

I havn't checked the code yet, but I suspect that you changed the code to search for a free adapter when openvpn is started, but not actually open it until later.

Yes, we will probably need to set IFCONFIG_AFTER_TUN_OPEN for Windows, to avoid the double-open race.

James

#2 lore raw
In reply to Mathias Sundman
Quoted 30 lines · Mathias Sundman
Quoted 19 lines · Mathias Sundman

James,

I think we made a little misstake with the "auto-find free TAP device" feature.

In OpenVPN GUI >= beta20 I close the connections and restart them after a suspend. If multiple connections were running this means that they will all be re-started at the exact same time after the suspend.

I suppose the same thing happends when you start the service wrapper.

Anyway, I had two connections running, and after a suspend, one of the connections started fine, but the other one failed with the following message:

CreateFile failed on TAP device:
\\.\Global\{75E5A03B-F1A9-422E-8DBA-EFF4B55C1B07}.tap:
General failure (ERROR_GEN_FAILURE) (errno=31)

Quoted 8 lines

which is the same interface as the first connection used.

I havn't checked the code yet, but I suspect that you changed the code to search for a free adapter when openvpn is started, but not actually open it until later.

Both processes seemed to find the same interface free, but later one of them of cource failed to open it.

Quoted 8 lines

Forget it!!

My mistake. I'm testing far to many things at the same time now :-) I had simply specified a dev-node in one of the configs because I had todo some testing with OpenVPN 2.0-beta11 earlier and forgot to change it back.

I should of cource have checked my configs carefuly before posting... Sorry.

Aha!

Of course it still looks like we need IFCONFIG_AFTER_TUN_OPEN on Windows, because otherwise guess_tuntap_dev() will be called causing the double open and possible race.

James