From: "cron2 (Code Review)" Date: Fri, 26 Sep 2025 20:53:15 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., antonio@...2726... Message-ID: <0f5e245ca760c28c532edf57edf2500a53083340-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="4eDLmak1VOI="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: dco: Change sd argument to dco_new_peer from int to socket_descriptor_t List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld Cc: plaisthos , openvpn-devel --4eDLmak1VOI= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/11= 95?usp=3Demail ) Change subject: dco: Change sd argument to dco_new_peer from int to socket_= descriptor_t ...................................................................... dco: Change sd argument to dco_new_peer from int to socket_descriptor_t Doesn't change anything for non-Win32 platforms. Change-Id: I28f856c1c156b54089d95b2e2539ecdb374cdd37 Signed-off-by: Frank Lichtenheld Acked-by: Antonio Quartulli Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1195 Message-Id: <20250924151044.50567-1-frank@...2641...> URL: https://sourceforge.net/p/openvpn/mailman/message/59238248/ Signed-off-by: Gert Doering --- M src/openvpn/dco.c M src/openvpn/dco_internal.h M src/openvpn/dco_win.c 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/openvpn/dco.c b/src/openvpn/dco.c index 2cf90af..6afc680 100644 --- a/src/openvpn/dco.c +++ b/src/openvpn/dco.c @@ -491,11 +491,6 @@ return true; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - int dco_p2p_add_new_peer(struct context *c) { @@ -604,7 +599,7 @@ int peer_id =3D c->c2.tls_multi->peer_id; struct sockaddr *remoteaddr, *localaddr =3D NULL; struct sockaddr_storage local =3D { 0 }; - int sd =3D c->c2.link_sockets[0]->sd; + const socket_descriptor_t sd =3D c->c2.link_sockets[0]->sd; =20 if (c->mode =3D=3D CM_CHILD_TCP) @@ -650,10 +645,6 @@ return 0; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - void dco_install_iroute(struct multi_context *m, struct multi_instance *mi, str= uct mroute_addr *addr) { diff --git a/src/openvpn/dco_internal.h b/src/openvpn/dco_internal.h index 83013ef..86af003 100644 --- a/src/openvpn/dco_internal.h +++ b/src/openvpn/dco_internal.h @@ -59,7 +59,7 @@ * They are implemented by dco_linux.c */ -int dco_new_peer(dco_context_t *dco, unsigned int peerid, int sd, struct s= ockaddr *localaddr, +int dco_new_peer(dco_context_t *dco, unsigned int peerid, socket_descripto= r_t sd, struct sockaddr *localaddr, struct sockaddr *remoteaddr, struct in_addr *vpn_ipv4, st= ruct in6_addr *vpn_ipv6); int dco_del_peer(dco_context_t *dco, unsigned int peerid); diff --git a/src/openvpn/dco_win.c b/src/openvpn/dco_win.c index 7dd43d6..4dd307f 100644 --- a/src/openvpn/dco_win.c +++ b/src/openvpn/dco_win.c @@ -415,10 +415,10 @@ } int -dco_new_peer(dco_context_t *dco, unsigned int peerid, int sd, struct socka= ddr *localaddr, +dco_new_peer(dco_context_t *dco, unsigned int peerid, socket_descriptor_t = sd, struct sockaddr *localaddr, struct sockaddr *remoteaddr, struct in_addr *vpn_ipv4, struct= in6_addr *vpn_ipv6) { - msg(D_DCO_DEBUG, "%s: peer-id %d, fd %d", __func__, peerid, sd); + msg(D_DCO_DEBUG, "%s: peer-id %d, fd " SOCKET_PRINTF, __func__, peerid= , sd); if (dco->ifmode =3D=3D DCO_MODE_P2P) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1195?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: I28f856c1c156b54089d95b2e2539ecdb374cdd37 Gerrit-Change-Number: 1195 Gerrit-PatchSet: 8 Gerrit-Owner: flichtenheld Gerrit-Reviewer: ordex Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: merged --4eDLmak1VOI= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 submitted this change.

View Change

dco: Change sd argument to dco_new_peer from =
int to socket_descriptor_t

Doesn't change anything for non-Win32= platforms.

Change-Id: I28f856c1c156b54089d95b2e2539ecdb374cdd37
= Signed-off-by: Frank Lichtenheld <frank@...2641...>
Acked-by: Anto= nio Quartulli <antonio@...2726...>
Gerrit URL: https://gerrit.open= vpn.net/c/openvpn/+/1195
Message-Id: <20250924151044.50567-1-frank@...1186...= .2641...>
URL: https://sourceforge.net/p/openvpn/mailman/message/5923= 8248/
Signed-off-by: Gert Doering <gert@...1296...>
---
M sr= c/openvpn/dco.c
M src/openvpn/dco_internal.h
M src/openvpn/dco_win.c<= br>3 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/src/openvpn/dco.c b/src/openvpn/dco.c
index= 2cf90af..6afc680 100644
--- a/src/openvpn/dco.c
= +++ b/src/openvpn/dco.c
@@ -491,11 +491,6 @@ return true;
}

-#if defined(__GNUC__) || defined(_= _clang__)
-#pragma GCC = diagnostic push
-#pragm= a GCC diagnostic ignored "-Wconversion"
-#endif
-
int
dco_p2p_add_new_peer(st= ruct context *c)
{
@@ -604,7 +599,7 @@

int peer_id =3D c->c2.tls_multi->peer_id; struct sockaddr *remoteaddr, *localaddr =3D NULL;
struct sockaddr_storage local =3D { 0 };
- int sd =3D c->c2.link_sockets[0]->sd;<= /span>
+ const socket_des= criptor_t sd =3D c->c2.link_sockets[0]->sd;
<= br>
if (c->mode =3D=3D CM_CHILD_TCP)<= br>@@ -650,10 +645,6 @@
return 0;
}


= -#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
void
dco_install_iroute(str= uct multi_context *m, struct multi_instance *mi, struct mroute_addr *addr)<= /span>
{
diff --git a/src/openvpn/dco_internal.h = b/src/openvpn/dco_internal.h
index 83013ef..86af003 100644<= /span>
--- a/src/openvpn/dco_internal.h
+++ b/src/= openvpn/dco_internal.h
@@ -59,7 +59,7 @@
= * They are implemented by dco_linux.c
*/
=
-int dco_new_peer(dco= _context_t *dco, unsigned int peerid, int sd, struct sockaddr *localaddr,
+int dco_new_peer(dco_= context_t *dco, unsigned int peerid, socket_descriptor_t sd, struct sockadd= r *localaddr,
struct sockaddr *remoteaddr= , struct in_addr *vpn_ipv4, struct in6_addr *vpn_ipv6);

int dco_del_peer(dco_context_t *dco, unsigned int peerid);<= /span>
diff --git a/src/openvpn/dco_win.c b/src/openvpn/dco_win.c<= /span>
index 7dd43d6..4dd307f 100644
--- a/src/ope= nvpn/dco_win.c
+++ b/src/openvpn/dco_win.c
= @@ -415,10 +415,10 @@
}

= int
-dco_new_peer(dco_= context_t *dco, unsigned int peerid, int sd, struct sockaddr *localaddr,
+dco_new_peer(dco_conte= xt_t *dco, unsigned int peerid, socket_descriptor_t sd, struct sockaddr *lo= caladdr,
struct sockaddr *remoteaddr, struct = in_addr *vpn_ipv4, struct in6_addr *vpn_ipv6)
{
= - msg(D_DCO_DEBUG, "%s: p= eer-id %d, fd %d", __func__, peerid, sd);
+ msg(D_DCO_DEBUG, "%s: peer-id %d, fd &q= uot; SOCKET_PRINTF, __func__, peerid, sd);

if (dco->ifmode =3D=3D DCO_MODE_P2P)

{

To view, visit change 1195. To unsubscribe, or f= or help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I28f856c1c156b54089d95b2e253= 9ecdb374cdd37
Gerrit-Change-Number: 1195
Gerrit-PatchSet: 8
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: ordex <antonio@...2726...&= gt;
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: merged
--4eDLmak1VOI=--