From patchwork Wed Sep 24 15:10:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Lichtenheld X-Patchwork-Id: 4450 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:c08a:b0:72f:f16c:e055 with SMTP id jr10csp1618796mab; Wed, 24 Sep 2025 08:11:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW8Y3JhTbwLcBUraiLVvcxkK/sGwv+nZ/g3gMzdr/BLqCLRpP3AlBgUbmHn32OyCOIfVBMNmFCS2n4=@openvpn.net X-Google-Smtp-Source: AGHT+IGx2Mfciofn3ZGQcjS53rnbxJjX0m8Bq/uzZISGWu8lSs+NkZHrDMdT6fBGUqa3Xax9fLNA X-Received: by 2002:a05:6808:1b11:b0:43f:2bb2:91d4 with SMTP id 5614622812f47-43f4cbf33ffmr182820b6e.3.1758726666307; Wed, 24 Sep 2025 08:11:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1758726666; cv=none; d=google.com; s=arc-20240605; b=XkxyXNN049/7XkUJyW7JUp/nnkbi/JUSiBj9zsPDDT6d8ft5PA4NI3zG/nbpgsWr8R M6Oqrw/znY9imPgzWJ0f/iiyE+GG/nv2WfsbeRY9TMv1HQf+Cd8w+SifCC4aMDPd/v1X UY5z4j20TRo8Uh7bjSbgh1YssIWC8Qj041bTsDf8gjrQeP9RdpVVctjl5Ft53hMgVn+n ywu+y27WNbayXaWWKFl7H/+YevQfbBu0nWt/TLpL4w7UOJ3StL+hIP0dDQfid1ngFCKL uyNt7n/dC8dkwGL1gTduLbcMGXywCX2OcI8/q+WoT5fIZRLQIPLw1YrgecuFZfSV/mcZ jgkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:cc:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature:dkim-signature; bh=dzzbdBnXCPIYAE7/ydDVxfWiSMU7jOkBecMMBoSvZFk=; fh=10tBNjXj/wkJoIBSfHvI5xr4knRr+m5zCVrzABMRuHI=; b=HuWppK/Z+/aHhcz+t+iCiNmLKaiqwV+/SaNP6u81Xey9+q1qJY36VDYrggCZRj1Hyn TtMq78jxWTC1R7TIW14Kdljfwgp7ii3VVvy9p0BFSGrHS2Fnn5Uop+TZv/wwR1tHp5xR wRyObibrvoYIFItbeKvWjdNv9o4pr8SlNerUWJ55q+bfO/Zgrcd30AwqFl+xfkf2+qJw eqd5td2mRNCtPJ5uqWm5CZiRq1iG4bKBC9oZkgwbTFpE2x08hMVGEVbowaYvZOBKNLIA XwL4JyO4Kvhs4RtKTgjWYJT1doM30ifQYi/fjybKcoiRmcPnqas9ndB4QpdIloj+XQHG 74uA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=NDqej6en; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=KwS+zpEm; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=m3k0cKN5; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=J9wfZzH4; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 5614622812f47-43f2664ad57si1528264b6e.39.2025.09.24.08.11.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Sep 2025 08:11:06 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=NDqej6en; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=KwS+zpEm; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=m3k0cKN5; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=J9wfZzH4; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=dzzbdBnXCPIYAE7/ydDVxfWiSMU7jOkBecMMBoSvZFk=; b=NDqej6enUOIvSz9MSONEZ3H15i bzMPb467Kxc74ds+H3wYxw3670DA3EbKcV/PDWocDz9ZTwAYV9UyUwI9N1bZO1EyL4ck8alTxnfzl /DvcHmb+y0YvJLqFMGHmSoYz8vA3Q79+99HdR+JWpyVFo52Lks3HCA084k3AsjIVR/XM=; Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1v1R95-0000SW-Ao; Wed, 24 Sep 2025 15:11:04 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1v1R92-0000S3-7a for openvpn-devel@lists.sourceforge.net; Wed, 24 Sep 2025 15:11:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=hC30y5FCEqqi+QaMMYohtxA+T4V817f1LjWZekcZLd4=; b=KwS+zpEmQLzh6bN4zvrawIXFXI /E+yY7mRJYCdFKghX0y6O5KJSsRVNsyzmDPUJXk0204kYzyfH4rH1vp5mz9dcapitKQAcAfPqJefV VpLBzJLR8qh+qyBM4FlPRiiS6+8643/PFASa26/fu0orx9qXHtqgPWep+u+z/0SR9U24=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=hC30y5FCEqqi+QaMMYohtxA+T4V817f1LjWZekcZLd4=; b=m3k0cKN5b3zvenoq1+DTLOyQvs jkr0wAqEoOHq2PklY4wgsJIOOx/zpVHVnTj5lgrd7gFibFJRbPC83oo6Mn8Vtq8N1Y50rOPYgbfT9 0pj+WG3oGlcKFwYI18Icy6gofnrX15nZNH5ovfNvcyb32xOS3EdGxQFHleoxZbj+XmNY=; Received: from mout-p-202.mailbox.org ([80.241.56.172]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1v1R91-0002aa-Vy for openvpn-devel@lists.sourceforge.net; Wed, 24 Sep 2025 15:11:00 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4cX0fG3dYYz9smD; Wed, 24 Sep 2025 17:10:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lichtenheld.com; s=MBO0001; t=1758726646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hC30y5FCEqqi+QaMMYohtxA+T4V817f1LjWZekcZLd4=; b=J9wfZzH4eGQnWGqSPIDh+4nKj8tjYX03miuhBrr9VI+Yf4vQxPgp4HR13X7+ux3HXe5LTi dDBHADFQ3hZ08MwTTLektTOk865GlcpfhOK9Nwbh4v5S7WY+r8XY6gJkEB5WjydHOh7KDp TL+D0xjEyo6xdaVOaTWLZ9OVZzO1wWiSXIDZUBKCCzlJjQFTOU74AgoTanJmPyGwMYiAlY hnZTd0l7nnDyw+JtvmRWwKflXdhG65rOpTztu64X9SvMIWGYDgWHSAqNDpAaiT8MV7aO7r tFEM+o6oXEpTrkkV/1GoUA4zzQcsIsqunBoo1J9EKuOIgvGgnanZ7j+J+W3pMQ== From: Frank Lichtenheld To: openvpn-devel@lists.sourceforge.net Date: Wed, 24 Sep 2025 17:10:44 +0200 Message-Id: <20250924151044.50567-1-frank@lichtenheld.com> In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-1.hosts.colo.sdot.me", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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 [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-Headers-End: 1v1R91-0002aa-Vy Subject: [Openvpn-devel] [PATCH v7] dco: Change sd argument to dco_new_peer from int to socket_descriptor_t X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Antonio Quartulli Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1844158572797281238?= X-GMAIL-MSGID: =?utf-8?q?1844158572797281238?= 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 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1195 This mail reflects revision 7 of this Change. Acked-by according to Gerrit (reflected above): Antonio Quartulli 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 = c->c2.tls_multi->peer_id; struct sockaddr *remoteaddr, *localaddr = NULL; struct sockaddr_storage local = { 0 }; - int sd = c->c2.link_sockets[0]->sd; + const socket_descriptor_t sd = c->c2.link_sockets[0]->sd; if (c->mode == 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, struct 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 sockaddr *localaddr, +int 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); 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 9e52859..fc9551d 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 sockaddr *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 == DCO_MODE_P2P) {