From: "cron2 (Code Review)" Date: Tue, 17 Sep 2024 10:40:42 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., gianmarco@...2726..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <4cc89578cc616a5526fab920e0872fddae02549d-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="q2aXRdypZHc="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Route: remove incorrect routes on exit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: its_Giaan , plaisthos , flichtenheld Cc: openvpn-devel --q2aXRdypZHc= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#3) to the change originally created by= its_Giaan. ( http://gerrit.openvpn.net/c/openvpn/+/522?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by flichtenheld Change subject: Route: remove incorrect routes on exit ...................................................................... Route: remove incorrect routes on exit Implemented a safeguard to verify the returned value from add_route3() when the default gateway is not a local remote host. Prior to this implementation, RT_DID_LOCAL flag was erroneously set even in case of add_route3() failure. This problem typically occurs when there's no default route and the --redirect-gateway def1 option is specified, and in case of reconnection makes it impossible for the client to reobtain the route to the server. This fix ensures OpenVPN accurately deletes the appropriate route on exit by properly handling add_route3() return value. Trac: #1457 Change-Id: I8a67b82eb4afdc8d82c5a879c18457b41e77cbe7 Signed-off-by: Gianmarco De Gregori Acked-by: Frank Lichtenheld Message-Id: <20240221111814.942965-1-frank@...2641...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28= 290.html Signed-off-by: Gert Doering --- M src/openvpn/route.c 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/22/522/3 diff --git a/src/openvpn/route.c b/src/openvpn/route.c index 91f2032..2e584c7 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -1060,7 +1060,10 @@ ret =3D add_route3(rl->spec.remote_host, IPV4_NETMASK_= HOST, rl->rgi.gateway.addr, tt, flags | ROU= TE_REF_GW, &rl->rgi, es, ctx); - rl->iflags |=3D RL_DID_LOCAL; + if (ret) + { + rl->iflags |=3D RL_DID_LOCAL; + } } else { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/522?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: I8a67b82eb4afdc8d82c5a879c18457b41e77cbe7 Gerrit-Change-Number: 522 Gerrit-PatchSet: 3 Gerrit-Owner: its_Giaan Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --q2aXRdypZHc= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #3 to the change originally cr= eated by its_Giaan.

View Change

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

Route: remove incorrect routes on exit
Implemented a safeguard to verify the returned value
from add_route3() = when the default gateway is not a local
remote host.

Prior to thi= s implementation, RT_DID_LOCAL flag was
erroneously set even in case of = add_route3() failure.
This problem typically occurs when there's no = default
route and the --redirect-gateway def1 option is specified,
an= d in case of reconnection makes it impossible for the client
to reobtain= the route to the server.
This fix ensures OpenVPN accurately deletes th= e appropriate
route on exit by properly handling add_route3() return val= ue.

Trac: #1457
Change-Id: I8a67b82eb4afdc8d82c5a879c18457b41e77c= be7
Signed-off-by: Gianmarco De Gregori <gianmarco@...2726...>
= Acked-by: Frank Lichtenheld <frank@...2641...>
Message-Id: <202= 40221111814.942965-1-frank@...2641...>
URL: https://www.mail-archive.= com/openvpn-devel@lists.sourceforge.net/msg28290.html
Signed-off-by: Ger= t Doering <gert@...1296...>
---
M src/openvpn/route.c
1 file= changed, 4 insertions(+), 1 deletion(-)

git pull ssh://gerrit.op=
envpn.net:29418/openvpn refs/changes/22/522/3
diff --git a/src/open=
vpn/route.c b/src/openvpn/route.c
index 91f2032..2e584c7 10= 0644
--- a/src/openvpn/route.c
+++ b/src/op= envpn/route.c
@@ -1060,7 +1060,10 @@
= ret =3D add_route3(rl->spec.remote_host, IPV4_NETMASK_HOS= T,
rl->rgi.gateway= .addr, tt, flags | ROUTE_REF_GW,
= &rl->rgi, es, ctx);
- rl->iflags |=3D RL_DID_LOCAL;
+ if (r= et)
+ = {
+ = rl->iflags |=3D RL_DID_LOCAL;
+ }
= }
else
= {

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

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I8a67b82eb4afdc8d82c5a879c18= 457b41e77cbe7
Gerrit-Change-Number: 522
Gerrit-PatchSet: 3
Gerrit-Owner: its_Giaan <gianmarco@...2786...= ..>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--q2aXRdypZHc=--