From patchwork Mon Oct 6 21:01:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4469 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:7505:b0:72f:f16c:e055 with SMTP id r5csp7102855mai; Mon, 6 Oct 2025 14:01:40 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWqw8/skM6qe3vSmi/zeY/XxBRwxes6ZqDxkX8lG6MBDzaf/LK23t1QRrMKxgsQTDyYTiAu6centNc=@openvpn.net X-Google-Smtp-Source: AGHT+IH/hwVYwNVTz/iEXrCydGdlPhpl0Iun5FsdR4tMHO5GAAat8QSXiiQi4LidG+J48iFd1dsD X-Received: by 2002:a05:6830:638d:b0:7bf:6f5e:ea3 with SMTP id 46e09a7af769-7bf772e9f95mr7885270a34.10.1759784500141; Mon, 06 Oct 2025 14:01:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1759784500; cv=none; d=google.com; s=arc-20240605; b=HnLU3y1lZMreYQxwchsRWyl4ClHvZnHVbwHj1MOm/lol+ekru13M3CrhvHUe5zvbak /zNiDsGVUH1Mv3ju88xoIGIuoNT4aFMWgCme79/ea4F4SnCvoOjkL3z1rZFNHSAo3oTd S+w8RJ7P1ZG9jfWsSv4vI0rDxRDkGXmoKOcv9qTHlRWgT9tiXK7ABYskk+ExUodmYTRZ xlf/IV+XAowkYNU2wCl6rGnB6j1QCxZCn9zw9GMcteREjcurzKZJtt2F4s/G/+Fith5I PohhsN92ZqNMGxhOOr2ebDJEC41NEEc7IGqo/TiSTYOKg1qLmF5TLM0qGT+nIBBig17B /Shg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding: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; bh=N8J/Fo76pVbivM975gAvS7ARrzvyVdo9dOXgSYqembM=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=LX1O53Q56nRHKsxVx1FgIVIbtMKt5QjkzkdKt5NMDjeW7lt9dkQq2qoJshTwsBGmZZ EoFMSQ8FZ/79PpYp6mCQP7WM4n0fWva7xCiYY+viNHkHOAbNiMgkhByPE6rsC7L9QaG7 2AhLMRrRnfdr4l5jrGADphYaL22pFtSDfZ+OqJ7UhcVKz2wLE53C+kE0YjX0sW6SMVBJ 8YsSscJ3n7zEmhjhPN4gRpF5gHcpHEKDMHs0S2i+VYM/Z2aBBMcpf6mgKy5n9yr6ysUN Kymvd5wtgOg1E9IPn0ssXGjuhbQzkzyXaM022G2FE97LpB7XXKHamCJ1GaTtWIfSxj6C YtHw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=TNjm0y0J; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=URMojseP; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=NeRQnSNt; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 46e09a7af769-7c06be337ecsi153712a34.265.2025.10.06.14.01.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Oct 2025 14:01:39 -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=TNjm0y0J; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=URMojseP; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=NeRQnSNt; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de 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: 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:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=N8J/Fo76pVbivM975gAvS7ARrzvyVdo9dOXgSYqembM=; b=TNjm0y0Jv7arMcSanVezsqi0d9 a73olNhYkvIN8dQlR3y55wpw21ZPd1If1k4aqktHFiY6++LCFsp1Mcfbsi07fH3QsJD1mbxJyUaka swrBUAqSy5YnNQsG/zV5I13zBcRNe/ELmgJR7OWrwbycXTv4JprFBs0rimPr+lP1GbFc=; Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1v5sKu-00061P-TV; Mon, 06 Oct 2025 21:01:36 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1v5sKt-00061I-O9 for openvpn-devel@lists.sourceforge.net; Mon, 06 Oct 2025 21:01:35 +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:To:From:Sender:Reply-To:Cc: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=Iyiqg5FsWF+UNBc64hfaifON7uIhh8mVIUuSdMoZU4w=; b=URMojseP1q3NYOopIucHh8HSZI lB2DApWu5VEYJT2bnPDSvgOBUPBIqJm0+kwY5DlpRRAX+0Pfz8qzstf6lubYHZcKaM11TgVmA5Uf9 t3Oqdvzk1mjQSMJdio68VBoDTyMX+qoJp/+0HDdZuXIIWCN/cKo4S1DvpcVo35kXQSzI=; 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:To:From:Sender:Reply-To:Cc: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=Iyiqg5FsWF+UNBc64hfaifON7uIhh8mVIUuSdMoZU4w=; b=NeRQnSNt8WaZRutE7oG0zmrARz eNieYIWJodj33Xhx0PT6BHWH92diJA7h+UFa+ItqGMxSbtKPPRAUrIsamh7oNPorbsfp0eSG87Kup HkgTVO3rKpZQ9LMsBMXD9uOmjw8NZ4rPkdCCQWBaTf/LlYLWw5AeK+iq9im6XztgD0No=; Received: from [193.149.48.134] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1v5sKs-0003EV-Lb for openvpn-devel@lists.sourceforge.net; Mon, 06 Oct 2025 21:01:35 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 596L1SKQ028693 for ; Mon, 6 Oct 2025 23:01:28 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 596L1SfU028692 for openvpn-devel@lists.sourceforge.net; Mon, 6 Oct 2025 23:01:28 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Mon, 6 Oct 2025 23:01:21 +0200 Message-ID: <20251006210127.28679-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.49.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) 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: From: Frank Lichtenheld - Use correct type for pointer difference - Make sure that small sizeof sum is treated as int Change-Id: Ie0c0fbf4f7f8b379d46b6755c4eff209acc20fef Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/open [...] Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1v5sKs-0003EV-Lb Subject: [Openvpn-devel] [PATCH v3] dhcp: Fix conversion warnings 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: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1845267791609828557?= X-GMAIL-MSGID: =?utf-8?q?1845267791609828557?= From: Frank Lichtenheld - Use correct type for pointer difference - Make sure that small sizeof sum is treated as int Change-Id: Ie0c0fbf4f7f8b379d46b6755c4eff209acc20fef Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1241 --- 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/+/1241 This mail reflects revision 3 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/dhcp.c b/src/openvpn/dhcp.c index 38e8d40..850a4b6 100644 --- a/src/openvpn/dhcp.c +++ b/src/openvpn/dhcp.c @@ -72,11 +72,6 @@ return -1; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - static in_addr_t do_extract(struct dhcp *dhcp, int optlen) { @@ -115,7 +110,7 @@ const int owlen = len + 2; /* len of data to overwrite */ uint8_t *src = dest + owlen; uint8_t *end = p + optlen; - const int movlen = end - src; + const intptr_t movlen = end - src; if (movlen > 0) { memmove(dest, src, movlen); /* overwrite router option */ @@ -155,7 +150,7 @@ struct dhcp_full *df = (struct dhcp_full *)BPTR(ipbuf); const int optlen = BLEN(ipbuf) - - (sizeof(struct openvpn_iphdr) + sizeof(struct openvpn_udphdr) + sizeof(struct dhcp)); + - (int)(sizeof(struct openvpn_iphdr) + sizeof(struct openvpn_udphdr) + sizeof(struct dhcp)); if (optlen >= 0 && df->ip.protocol == OPENVPN_IPPROTO_UDP && df->udp.source == htons(BOOTPS_PORT) && df->udp.dest == htons(BOOTPC_PORT) @@ -190,7 +185,3 @@ } return 0; } - -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif