From: "ralf_lici (Code Review)" Date: Tue, 17 Jun 2025 07:28:27 +0000 References: Reply-To: ralf@...2726..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <768b8519ee05f44e620493989ef300eca0c8a675-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="cpkxtDM5c6Q="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Preserve socket protocol during float processing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --cpkxtDM5c6Q= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1063?usp=3Demail to review the following change. Change subject: Preserve socket protocol during float processing ...................................................................... Preserve socket protocol during float processing During a float operation, we remove the old `mroute` object corresponding to the current multi instance from the hash table and insert a new one. With the introduction of the multi-socket feature, the `mroute` structure gained a `proto` field, which must also be set in the new instance, otherwise, hash table lookups will fail. This commit ensures that the `proto` field is propagated from the original to the new `mroute` object during float processing. Change-Id: I0e17d9aea32eab7f44ed95037f077ae6dec52053 Signed-off-by: Ralf Lici --- M src/openvpn/multi.c 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/63/1063/1 diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 169af43..a760e07 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -3217,6 +3217,12 @@ struct hash *hash =3D m->hash; struct gc_arena gc =3D gc_new(); + if (mi->real.type & MR_WITH_PROTO) + { + real.type |=3D MR_WITH_PROTO; + real.proto =3D sock->info.proto; + } + if (!mroute_extract_openvpn_sockaddr(&real, &m->top.c2.from.dest, true= )) { goto done; -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1063?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: I0e17d9aea32eab7f44ed95037f077ae6dec52053 Gerrit-Change-Number: 1063 Gerrit-PatchSet: 1 Gerrit-Owner: ralf_lici Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-MessageType: newchange --cpkxtDM5c6Q= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos.

ralf_lici would like plaisthos and flichtenheld to review this change.

V= iew Change

Preserve socket protocol during float processing

Duri= ng a float operation, we remove the old `mroute` object
corresponding to= the current multi instance from the hash table and
insert a new one. Wi= th the introduction of the multi-socket feature, the
`mroute` structure = gained a `proto` field, which must also be set in the
new instance, othe= rwise, hash table lookups will fail.

This commit ensures that the `p= roto` field is propagated from the
original to the new `mroute` object d= uring float processing.

Change-Id: I0e17d9aea32eab7f44ed95037f077ae6= dec52053
Signed-off-by: Ralf Lici <ralf@...2726...>
---
M sr= c/openvpn/multi.c
1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/63/1063/1<=
/pre>
+    if (mi->real.type & MR_WI=
TH_PROTO)
+ {
+ real.type |=3D M= R_WITH_PROTO;
+ = real.proto =3D sock->info.proto;
+ }
+
if (!mroute_extract_openvpn_sockaddr(&real, &= amp;m->top.c2.from.dest, true))
{
= goto done;

To view, visit change 1063. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I0e17d9aea32eab7f44ed95037f0= 77ae6dec52053
Gerrit-Change-Number: 1063
Gerrit-PatchSet: 1
Gerrit-Owner: ralf_lici <ralf@...2726...>= ;
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-MessageType: newchange
--cpkxtDM5c6Q=--