From: "cron2 (Code Review)" Date: Tue, 17 Jun 2025 09:18:31 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., gianmarco@...2726..., openvpn-devel@lists.sourceforge.net, ralf@...2726..., frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="q0vYFPcvh/A="; 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: ralf_lici Cc: its_Giaan , plaisthos , flichtenheld , openvpn-devel --q0vYFPcvh/A= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/10= 63?usp=3Demail ) 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 Acked-by: Gianmarco De Gregori Message-Id: <20250617084136.10215-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg31= 902.html URL: https://gerrit.openvpn.net/c/openvpn/+/1063 Signed-off-by: Gert Doering --- M src/openvpn/multi.c 1 file changed, 6 insertions(+), 0 deletions(-) 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: 2 Gerrit-Owner: ralf_lici Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: its_Giaan Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: merged --q0vYFPcvh/A= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 submitted this change.

View Change

Preserve socket protocol during float process=
ing

During a float operation, we remove the old `mroute` object
c= orresponding to the current multi instance from the hash table and
inser= t a new one. With the introduction of the multi-socket feature, the
`mro= ute` structure gained a `proto` field, which must also be set in the
new= instance, otherwise, hash table lookups will fail.

This commit ensu= res that the `proto` field is propagated from the
original to the new `m= route` object during float processing.

Change-Id: I0e17d9aea32eab7f4= 4ed95037f077ae6dec52053
Signed-off-by: Ralf Lici <ralf@...2726...>=
Acked-by: Gianmarco De Gregori <gianmarco@...2726...>
Message-= Id: <20250617084136.10215-1-gert@...1296...>
URL: https://www.mail= -archive.com/openvpn-devel@lists.sourceforge.net/msg31902.html
URL: http= s://gerrit.openvpn.net/c/openvpn/+/1063
Signed-off-by: Gert Doering <= gert@...1296...>
---
M src/openvpn/multi.c
1 file changed, 6 in= sertions(+), 0 deletions(-)

diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c
i= ndex 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_PR= OTO)
+ {+ real.type |=3D MR_WIT= H_PROTO;
+ rea= l.proto =3D sock->info.proto;
+ }
+<= /span>
if (!mroute_extract_openvpn_sockaddr(&real, &m= ->top.c2.from.dest, true))
{
= goto done;

To view, visit change 1063. T= o 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: 2
Gerrit-Owner: ralf_lici <ralf@...2726...>= ;
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: its_Giaan <gianmarco@...1664...= 26...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: merged
--q0vYFPcvh/A=--