From: "cron2 (Code Review)" Date: Sun, 2 Feb 2025 09:49:11 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., lstipakov@...277..., a@...2181... Message-ID: <00b9a432e2dde534781867b8a59aa51e87380c23-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="c2NrTzDaM6E="; charset=UTF-8 Subject: [Openvpn-devel] [M] Change in openvpn[master]: multi.c: add iroutes after dco peer is added List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: stipa , plaisthos , flichtenheld Cc: openvpn-devel --c2NrTzDaM6E= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#8) to the change originally created by= stipa. ( http://gerrit.openvpn.net/c/openvpn/+/856?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by cron2 Change subject: multi.c: add iroutes after dco peer is added ...................................................................... multi.c: add iroutes after dco peer is added This doesn't matter for Linux and FreeBSD but matters for dco-win, where iroute subnet is mapped to a peer context, which means that peer has to be created before iroute is added. Change-Id: I1cac0f036504c87205a3c97589a94a662cf79b99 Signed-off-by: Lev Stipakov Acked-by: Gert Doering Message-Id: <20250201121102.27395-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg30= 780.html Signed-off-by: Gert Doering --- M src/openvpn/multi.c 1 file changed, 29 insertions(+), 24 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/56/856/8 diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index b0e1941..96fa6cd 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -2442,6 +2442,35 @@ ifconfig_constraint_network, ifconfig_constraint_netmask); } + /* set our client's VPN endpoint for status reporting purposes */ + mi->reporting_addr =3D mi->context.c2.push_ifconfig_local; + mi->reporting_addr_ipv6 =3D mi->context.c2.push_ifconfig_ipv6_local; + + /* set context-level authentication flag */ + mi->context.c2.tls_multi->multi_state =3D CAS_CONNECT_DONE; + + /* Since dco-win maintains iroute routing table (subnet -> peer), + * peer must be added before iroutes. For other platforms it doesn't m= atter. */ + + /* authentication complete, calculate dynamic client specific options = */ + if (!multi_client_set_protocol_options(&mi->context)) + { + mi->context.c2.tls_multi->multi_state =3D CAS_FAILED; + } + /* only continue if setting protocol options worked */ + else if (!multi_client_setup_dco_initial(m, mi, &gc)) + { + mi->context.c2.tls_multi->multi_state =3D CAS_FAILED; + } + /* Generate data channel keys only if setting protocol options + * and DCO initial setup has not failed */ + else if (!multi_client_generate_tls_keys(&mi->context)) + { + mi->context.c2.tls_multi->multi_state =3D CAS_FAILED; + } + + /* dco peer has been added, it is now safe for Windows to add iroutes = */ + /* * For routed tunnels, set up internal route to endpoint * plus add all iroute routes. @@ -2489,30 +2518,6 @@ multi_instance_string(mi, false, &gc)); } - /* set our client's VPN endpoint for status reporting purposes */ - mi->reporting_addr =3D mi->context.c2.push_ifconfig_local; - mi->reporting_addr_ipv6 =3D mi->context.c2.push_ifconfig_ipv6_local; - - /* set context-level authentication flag */ - mi->context.c2.tls_multi->multi_state =3D CAS_CONNECT_DONE; - - /* authentication complete, calculate dynamic client specific options = */ - if (!multi_client_set_protocol_options(&mi->context)) - { - mi->context.c2.tls_multi->multi_state =3D CAS_FAILED; - } - /* only continue if setting protocol options worked */ - else if (!multi_client_setup_dco_initial(m, mi, &gc)) - { - mi->context.c2.tls_multi->multi_state =3D CAS_FAILED; - } - /* Generate data channel keys only if setting protocol options - * and DCO initial setup has not failed */ - else if (!multi_client_generate_tls_keys(&mi->context)) - { - mi->context.c2.tls_multi->multi_state =3D CAS_FAILED; - } - /* send push reply if ready */ if (mi->context.c2.push_request_received) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/856?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I1cac0f036504c87205a3c97589a94a662cf79b99 Gerrit-Change-Number: 856 Gerrit-PatchSet: 8 Gerrit-Owner: stipa Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: ordex Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --c2NrTzDaM6E= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #8 to the change originally cr= eated by stipa.

View Change

The following approvals got outdated and= were removed: Code-Review+2 by cron2

multi.c: add iroutes after dco peer is added

= This doesn't matter for Linux and FreeBSD but matters
for dco-win, w= here iroute subnet is mapped to a peer
context, which means that peer ha= s to be created before
iroute is added.

Change-Id: I1cac0f036504c= 87205a3c97589a94a662cf79b99
Signed-off-by: Lev Stipakov <lev@...1699...= .>
Acked-by: Gert Doering <gert@...1296...>
Message-Id: <= 20250201121102.27395-1-gert@...1296...>
URL: https://www.mail-archive= .com/openvpn-devel@lists.sourceforge.net/msg30780.html
Signed-off-by: Ge= rt Doering <gert@...1296...>
---
M src/openvpn/multi.c
1 fil= e changed, 29 insertions(+), 24 deletions(-)

git pull ssh://gerri=
t.openvpn.net:29418/openvpn refs/changes/56/856/8
diff --git a/src/=
openvpn/multi.c b/src/openvpn/multi.c
index b0e1941..96fa6c= d 100644
--- a/src/openvpn/multi.c
+++ b/sr= c/openvpn/multi.c
@@ -2442,6 +2442,35 @@
= ifconfig_constraint_network, ifconfig_constraint_netmask);
}

+ /* set our client's VPN endpoint for status reporti= ng purposes */
+ m= i->reporting_addr =3D mi->context.c2.push_ifconfig_local;
<= span style=3D"color: hsl(120, 100%, 40%);">+ mi->reporting_addr_ipv6 = =3D mi->context.c2.push_ifconfig_ipv6_local;

+
+ /* set context-level authentication flag */
+ mi->context.c2.tls_multi->mu= lti_state =3D CAS_CONNECT_DONE;
+
+ /* = Since dco-win maintains iroute routing table (subnet -> peer),+ * peer must be added bef= ore iroutes. For other platforms it doesn't matter. */
+
+ /* authentication complete, calculate dynamic clien= t specific options */
+ if (!multi_client_set_protocol_options(&mi->context))+ {
+ mi->context.c2.tls_multi->m= ulti_state =3D CAS_FAILED;
+ }
+ /* = only continue if setting protocol options worked */
+ else if (!multi_client_setup_dco_init= ial(m, mi, &gc))
= + {
+ mi-&g= t;context.c2.tls_multi->multi_state =3D CAS_FAILED;
+ }
+ /* Generate data channel keys only if setting prot= ocol options
+ * = and DCO initial setup has not failed */
+ else if (!multi_client_generate_tls_keys(&mi-&g= t;context))
+ {
+ mi->context= .c2.tls_multi->multi_state =3D CAS_FAILED;
+ }
+
+ /* = dco peer has been added, it is now safe for Windows to add iroutes */
+
/*<= /span>
* For routed tunnels, set up internal route to endpoi= nt
* plus add all iroute routes.
@@ -= 2489,30 +2518,6 @@
multi_instance_string(mi, f= alse, &gc));
}

- /* set our client's VPN endpoin= t for status reporting purposes */
- mi->reporting_addr =3D mi->context.c2.push_ifconfig_= local;
- mi->repo= rting_addr_ipv6 =3D mi->context.c2.push_ifconfig_ipv6_local;
<= span style=3D"color: hsl(0, 100%, 40%);">-

- /* set context-level authentication flag */=
- mi->context.c2.tls_mu= lti->multi_state =3D CAS_CONNECT_DONE;
-
- = /* authentication complete, calculate dynamic client specific options */=
- if (!multi_client= _set_protocol_options(&mi->context))
- {
- mi->context.c2.tls_multi->multi_state =3D CAS_FAILED;
- }
- /* only continue if setting protoco= l options worked */
- = else if (!multi_client_setup_dco_initial(m, mi, &gc))
- {

- mi->context.c2.tls_multi->multi_state = =3D CAS_FAILED;
- }<= /span>
- /* Generate data c= hannel keys only if setting protocol options
- * and DCO initial setup has not failed */
- else if (!multi_client_= generate_tls_keys(&mi->context))
- {
- mi->context.c2.tls_multi->multi_state =3D CAS_FAILED;
- }
-
/* send push reply if= ready */
if (mi->context.c2.push_request_received)=
{

To view, visit = change 85= 6. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I1cac0f036504c87205a3c97589a= 94a662cf79b99
Gerrit-Change-Number: 856
Gerrit-PatchSet: 8
Gerrit-Owner: stipa <lstipakov@...277...>= ;
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: ordex <a@...2181...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--c2NrTzDaM6E=--