Attention is currently required from: flichtenheld, plaisthos, stipa.

selvanair has posted comments on this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/943?usp=email )

Change subject: win: create adapter on demand
......................................................................


Patch Set 2: Code-Review+2

(4 comments)

File src/openvpn/tun.c:

http://gerrit.openvpn.net/c/openvpn/+/943/comment/cb1bafd2_52f5f731 :
PS2, Line 3781: static struct device_instance_id_interface *
This change is not required nor advisable. Same with panel_reg and tap_reg 
below.
Instead define them as const where used -- see below.


http://gerrit.openvpn.net/c/openvpn/+/943/comment/d1ebab33_cae54f35 :
PS2, Line 6656:     struct device_instance_id_interface 
*device_instance_id_interface = get_device_instance_id_interface(gc);
Define these three as "const struct ...". One can still re-assign them as 
required below.


http://gerrit.openvpn.net/c/openvpn/+/943/comment/ebac2853_5ed7005b :
PS2, Line 6707:                 if (adapter_created || (h && 
!do_create_adapter_service(h, tt->backend_driver)))
I think we need not limit this using the adapter_created flag. There is a kind 
of "race condition" where the created adapter may get opened by another 
openvpn.exe process before this one gets a chance to open it. Especially so 
with service created instances which all startup together.

In such cases it should be okay to create a new one again in the next round of 
this while loop. That will work transparently if adapter_created is not set and 
checked. If some protection against a run-away loop is needed, we could keep it 
as a number instead of as a bool -- like, do not create > 10 adapters in a run!


http://gerrit.openvpn.net/c/openvpn/+/943/comment/7ae3b2cb_836cd3b3 :
PS2, Line 6731:             if (tun_try_open_device(tt, *device_guid, 
device_instance_id_interface))
I think we should not limit this using the adapter_created flag here. There is 
a kind of "race condition" where the created adapter may get opened by another 
openvpn.exe process before this one gets a chance to open it. Especially so 
with service created instances which all startup together.

In such cases it should be okay to create again inn the second round which will 
work transparently if adapter_created is not set and checked. If some protectin 
against a run-away loop is needed, we could keep it as a number instead of as a 
bool -- like, do not create > 10 adapters!



--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/943?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I621d44ec6b0facc524875c15ddfd11ec47b06c15
Gerrit-Change-Number: 943
Gerrit-PatchSet: 2
Gerrit-Owner: stipa <lstipa...@gmail.com>
Gerrit-Reviewer: flichtenheld <fr...@lichtenheld.com>
Gerrit-Reviewer: plaisthos <arne-open...@rfc2549.org>
Gerrit-Reviewer: selvanair <selva.n...@gmail.com>
Gerrit-CC: openvpn-devel <openvpn-devel@lists.sourceforge.net>
Gerrit-Attention: plaisthos <arne-open...@rfc2549.org>
Gerrit-Attention: flichtenheld <fr...@lichtenheld.com>
Gerrit-Attention: stipa <lstipa...@gmail.com>
Gerrit-Comment-Date: Wed, 23 Apr 2025 22:25:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to