From patchwork Mon Nov 30 17:36:46 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5824 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:91c9:10b0:11b:d6c:f273 with SMTP id tl9-n1csp13375545lad; Mon, 30 Nov 2026 09:37:04 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErE4YWiQg7oqBPHAi21jJgJZKvUFOMN/wXY6G4iLzcfpqwOSHtyX1Erbg7SPy4B8aI4Vrr3SbKIqKNU=@openvpn.net X-Received: by 2002:a05:7022:3f0d:b0:1b5:32d6:6784 with SMTP id a92af1059eb24-1b5525f1012mr34061953c88.20.1796060224514; Mon, 30 Nov 2026 09:37:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1796060224; cv=none; d=google.com; s=arc-20260327; b=mHG9BKo1wIwU6D6p1vwITKPCTGn4tJiYzbBY7XpJcgmI5JjEthZPJ2BKiqm5Ap66NB s/rcrAlr7VF/QAhXNZW3MhXIwR/o7N6UU/LFeR4QCakT9XF9qCjAJ4/XeB2HZjptqD51 Jn5w6370b3juvmpL0G0xjD3XvG5kotoAX9fbK/q446oIG6JUuGw6qyqQUOtGOU0LA6Kr gvsTYsNJURPmQ/WhPY7oCgai8jOO8ojfRheN5rI66byXGe48dfS/cYxWNOgk8HSEWt5l tK828OWfQFlToUcxs+uDDYVTeA3byUuWDJig9g1ixubC0ScRxFkOnEkW/JqDV/UVxmsc 9aVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; 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=nAbwELrKbn/42wsWc0QilzIlycPoL9kpYLUYYASVRh8=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=J/wnl2K+AqRGBuNbyN2lrxPdDaND61WEdrRm56L4eOFPIoODuZqIh0rGIwS+Vh4Dku pjFDm8oq7Noyf8PXxEs1Ur84c79plhh/2aKb94UnGsS32+y3u5BhlUBZfW6MUDs6ZaZ5 k29nl+KkcERein6bO15bFM1jazyi75ey7c/ObHL8Y3GYcOhGjyoNsrBb+Mhs1CJy95hF vAf6UN6WcaBg8GJWQg2VPOlJTArUb/74K4ybpBCwiP1VTlkZxin1U0Gg6FKnDUNItbL+ lYFweq9fXpqio3l4n5StwaJ1ZXrILzyf6Tzo52upWiz1pluXFPCOxE/PPZRyrbss9rPs y6GQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=XQJSfJ1j; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=LFBGILzS; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=bGi96Oh9; 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 a92af1059eb24-1b55681ddafsi78861424c88.48.2026.11.30.09.37.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Nov 2026 09:37:04 -0800 (PST) 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=XQJSfJ1j; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=LFBGILzS; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=bGi96Oh9; 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-Unsubscribe-Post: List-Owner; bh=nAbwELrKbn/42wsWc0QilzIlycPoL9kpYLUYYASVRh8=; b=XQJSfJ1jDLV/ig 0mKJRRyxIuuTcTxfHIz9254YU3X+sCgfN+ggTWQhN+MtJ3ZZSg0zXYFZla38nn2neKt8RvNaP1I7X EEk3ponDOylSLDucDbDv44ccAwJYUcAGi/cQUbmwjFgrNWp0sLZPsxGoE6PZX2MLC8h6+GWUwuJ2I 77A=; 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.100.1) (envelope-from ) id 1xY5JH-0000000081K-0dev; Mon, 30 Nov 2026 17:37:03 +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.100.1) (envelope-from ) id 1xY5JF-00000000819-1Vba for openvpn-devel@lists.sourceforge.net; Mon, 30 Nov 2026 17:37:01 +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-Unsubscribe-Post:List-Subscribe:List-Post:List-Owner:List-Archive; bh=6Pi6PfAF6At4NuOtFZNeMAJ0qJ1sPFaP9aG/daNhYh4=; b=LFBGILzSm3Vk8cfd6QYwBm8Otr KcqZTE4fHkfE+rIP1CJQDGH6gZQwjIqUQcqBtN1oRa1zvMqg8lkW68/OQk0zcqIAHr0Mzz9z7ahcz 8zOnhD87IipAqh4yBJDYTmTlFxN2Q4qpSxWCksXW4rTNsnpB3VxYSsybVm5m+tUQs0cs=; 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-Unsubscribe-Post: List-Subscribe:List-Post:List-Owner:List-Archive; bh=6Pi6PfAF6At4NuOtFZNeMAJ0qJ1sPFaP9aG/daNhYh4=; b=bGi96Oh9HfCnsECwtiN1u9HFRx mKkMPAVidmxL4tcJGsGEPHRTyU3WL5RLwL7S5cCyn+cMv1gLMKDZjiJui/Ddh5LlETIHOfScOEk57 h1JvbJCez6sBVFOIdysR2uxsQ24he62wiad6QiIjogr82H1A4lEnRHxrlPuoB+YFQcew=; Received: from [193.149.48.129] (helo=blue.greenie.muc.de) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.100.1) id 1xY5JD-0000000032A-2zMp for openvpn-devel@lists.sourceforge.net; Mon, 30 Nov 2026 17:37:01 +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 6AUHaq2M030902 for ; Mon, 30 Nov 2026 18:36:52 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 6AUHaq87030901 for openvpn-devel@lists.sourceforge.net; Mon, 30 Nov 2026 18:36:52 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Mon, 30 Nov 2026 18:36:46 +0100 Message-ID: <20261130173652.30889-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.55.0 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 Since vid is limited by OPENVPN_8021Q_MASK_VID these casts are always safe. They are required since we use -1 for error reporting. Change-Id: I86381c949009cf6195255509bd3a9130cfe715ba Signed-off-by: Frank Lichtenheld Acked-by: Razvan Cojocaru Gerrit URL: https://gerrit.openvpn.net/c/o [...] 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: 1xY5JD-0000000032A-2zMp Subject: [Openvpn-devel] [PATCH v1] vlan: Avoid sign 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: 1883305645603221006 X-GMAIL-MSGID: 1883305645603221006 From: Frank Lichtenheld Since vid is limited by OPENVPN_8021Q_MASK_VID these casts are always safe. They are required since we use -1 for error reporting. Change-Id: I86381c949009cf6195255509bd3a9130cfe715ba Signed-off-by: Frank Lichtenheld Acked-by: Razvan Cojocaru Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2378 --- 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/+/2378 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Razvan Cojocaru diff --git a/src/openvpn/vlan.c b/src/openvpn/vlan.c index d44dac1..02a9bbe 100644 --- a/src/openvpn/vlan.c +++ b/src/openvpn/vlan.c @@ -56,11 +56,6 @@ (hdr->pcp_cfi_vid & ~OPENVPN_8021Q_MASK_VID) | (htons(vid) & OPENVPN_8021Q_MASK_VID); } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-conversion" -#endif - /* * vlan_decapsulate - remove 802.1q header and return VID * @@ -110,7 +105,7 @@ msg(D_VLAN_DEBUG, "assuming pvid for frame without vlan-tag, pvid: %u (proto/len 0x%04x)", c->options.vlan_pvid, ntohs(ethhdr->proto)); - return c->options.vlan_pvid; + return (int16_t)c->options.vlan_pvid; } /* tagged frame */ @@ -145,7 +140,7 @@ if (vid == 0) { /* return the global VID for priority-tagged frames */ - return c->options.vlan_pvid; + return (int16_t)c->options.vlan_pvid; } /* here we have a proper VLAN tagged frame: perform decapsulation @@ -167,7 +162,7 @@ /* restore the inner protocol value */ ethhdr->proto = proto; - return vid; + return (int16_t)vid; } drop: @@ -175,10 +170,6 @@ return -1; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - /* * vlan_encapsulate - add 802.1q header and set the context related VID *