From patchwork Sun Sep 14 13:51:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4414 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:6ad9:b0:671:5a2c:6455 with SMTP id v25csp760662maw; Sun, 14 Sep 2025 06:51:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX4eZ6tqpVHbAiLS8ldtLu9ofe2XywNU5WFJSK5EsLVgwieQhgafc4gfW6pEiQlQhdGT+tZjBcFklg=@openvpn.net X-Google-Smtp-Source: AGHT+IG/4OEQwU1qLjLijYBZML7nyyMU4x6AQhFT5Lj0misKivP+7bn+UEJ65lhTWiqwyX9WshZ+ X-Received: by 2002:a05:6808:a55c:20b0:43d:1e13:6a6d with SMTP id 5614622812f47-43d1e13b0e5mr1126251b6e.37.1757857905414; Sun, 14 Sep 2025 06:51:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1757857905; cv=none; d=google.com; s=arc-20240605; b=WM+E/hz5RrU3suaxKvDGfMPFhH0IGtJBSatquh9sQI6Iy0aazCMm3+eqqYRDGcwxpx v95QiZokg19KTUM/Npy8lsdIdOAjcDpeIAZ27YIzXXkoNNyf4KxTEYm6I0caVrEfw3d2 2/uSSzB56psBChJVZc6MD8S8jwDZ952w2euRckLKAwu3wPo0/D8qreEAh0nRCHDY0TEN 2VE0WXKXnPqQdPEIVeO56XcAMpyyBe1c27e5GCed5UAsZR4xGvpnHKt0PPC+kwNzAFQ0 APvNmEUuuBNi+3KFl5K79buCBE6DjB6EMHjFhSXgMGaEwofAkZJ5btpedMy+hgk3WrDp TwZg== 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=eMovPGTODoRSyihj9EpYkEFcs4xM0i67w3uSuBAAa9o=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=YK523TdXchdVveXr161mizoGX1HiLsYQ8cy7nHLFElDC3MjhgkAxZ4Zmz6k0gkvDkI d+Ctw2bxID3LlGpy7wgsKHj5ntfnQYt7rQ0mtIkSGHYOcBD7D9H9nZJ7apUURYBub5og ltLLxCubyS2gUzNk1wOB/MMVg0puj3umv5kCstYL/L+Mvnsgeyd0NpssTWUkLxNtwfOw u9JGxeEFBcfx00T17VDLaMWQ9/v87lhssJlNi1T1KfK+ax+VBUF4UJQmcbQb4fA29p4z mdUhvwTfxHh/Sl+uTIPD7nWGvAb6q58qANaPo4M9K3dRubmKhrzHFxSX501xvh4Oc3QA 107Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=TnEjY3hD; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Mder5RLa; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=X0LcRR7Z; 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 5614622812f47-43b8dda4a4fsi1692657b6e.140.2025.09.14.06.51.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Sep 2025 06:51:45 -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=TnEjY3hD; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Mder5RLa; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=X0LcRR7Z; 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=eMovPGTODoRSyihj9EpYkEFcs4xM0i67w3uSuBAAa9o=; b=TnEjY3hDJ3yGwPPSYDuj5nnUFr 8ds4kOFmO2ckeI2iI9PCVmATB1/ponpZbqHVaR6ETOvqn+hJYHz0h9GImv4ygjOYRpSzFwd7fRKnf LG7HvmX379gV1cOX7SL4kDqAyKnWCVjkCOc7TeGJPqiu8bytN2A61LtAiK2dJViu59LE=; 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 1uxn8o-0001ne-2i; Sun, 14 Sep 2025 13:51:42 +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 1uxn8m-0001nW-Io for openvpn-devel@lists.sourceforge.net; Sun, 14 Sep 2025 13:51:41 +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=qvV0nEctLZTZNy+41v11sNZnVDViQCRy7TUZIKf4fsk=; b=Mder5RLaygdbrVqVlZY8dE/8Io ERh4V8Gd63KbO1abE/NQvVyFBe+etYTd3310LsKcQd4RjVHhHZPvIpIjUlWDQU2tQmng5VXDKG8b3 NTT0NAsntaXsTK2QTRQSxuEvbKrqwfBi6z1phpJYL48982OZe/RGVpg0pUzQ4DaAI108=; 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=qvV0nEctLZTZNy+41v11sNZnVDViQCRy7TUZIKf4fsk=; b=X0LcRR7Z6fJhl5zVb/WGrDArW8 TAVZMAr/P5S7V1Y2ShIhHbZcxnEKekS/8UllcWBaQG8iFeSdD/IwdkD4GBio/4Y52ZVDvg6zzBsP0 dyIvXEFqisf31GCEycTPAQyhZMR+26vfGCdSMAN6D62Scso9WuKdXycLGMZ/3gsPLmq8=; 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 1uxn8m-0004uK-Hb for openvpn-devel@lists.sourceforge.net; Sun, 14 Sep 2025 13:51:41 +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 58EDpTTT019637 for ; Sun, 14 Sep 2025 15:51:29 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 58EDpTVL019636 for openvpn-devel@lists.sourceforge.net; Sun, 14 Sep 2025 15:51:29 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Sun, 14 Sep 2025 15:51:20 +0200 Message-ID: <20250914135128.19621-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-2.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 event_set_return.rwflags is already unsigned, make sure the flags are as well to avoid spurious conversion warnings. Requires to change rwflags in proxy_connection struct as well since those use the same flags. 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: 1uxn8m-0004uK-Hb Subject: [Openvpn-devel] [PATCH v10] events: Make sure rwflags are treated as unsigned 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?1843247610811063659?= X-GMAIL-MSGID: =?utf-8?q?1843247610811063659?= From: Frank Lichtenheld event_set_return.rwflags is already unsigned, make sure the flags are as well to avoid spurious conversion warnings. Requires to change rwflags in proxy_connection struct as well since those use the same flags. Change-Id: I0272b709b907545de05bfded03a649b259ce5af6 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering --- 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/+/1107 This mail reflects revision 10 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/event.h b/src/openvpn/event.h index 8422996..8a89a25 100644 --- a/src/openvpn/event.h +++ b/src/openvpn/event.h @@ -35,8 +35,8 @@ #define WRITE_SHIFT 1 #define EVENT_UNDEF 4 -#define EVENT_READ (1 << READ_SHIFT) -#define EVENT_WRITE (1 << WRITE_SHIFT) +#define EVENT_READ (1u << READ_SHIFT) +#define EVENT_WRITE (1u << WRITE_SHIFT) /* event flags returned by io_wait. * diff --git a/src/openvpn/ps.c b/src/openvpn/ps.c index eae03e3..b4199c3 100644 --- a/src/openvpn/ps.c +++ b/src/openvpn/ps.c @@ -70,7 +70,7 @@ struct proxy_connection *counterpart; struct buffer buf; bool buffer_initial; - int rwflags; + unsigned int rwflags; int sd; char *jfn; }; @@ -391,12 +391,12 @@ } static inline void -proxy_connection_io_requeue(struct proxy_connection *pc, const int rwflags_new, +proxy_connection_io_requeue(struct proxy_connection *pc, const unsigned int rwflags_new, struct event_set *es) { if (socket_defined(pc->sd) && pc->rwflags != rwflags_new) { - /*dmsg (D_PS_PROXY_DEBUG, "PORT SHARE PROXY: requeue[%d] rwflags=%d", (int)pc->sd, + /*dmsg (D_PS_PROXY_DEBUG, "PORT SHARE PROXY: requeue[%d] rwflags=%u", (int)pc->sd, * rwflags_new);*/ event_ctl(es, pc->sd, rwflags_new, (void *)pc); pc->rwflags = rwflags_new; @@ -656,7 +656,7 @@ * Decide how the receipt of an EAGAIN status should affect our next IO queueing. */ static bool -proxy_connection_io_status(const int status, int *rwflags_pc, int *rwflags_cp) +proxy_connection_io_status(const int status, unsigned int *rwflags_pc, unsigned int *rwflags_cp) { switch (status) { @@ -687,12 +687,13 @@ * in the proxied connection. */ static int -proxy_connection_io_dispatch(struct proxy_connection *pc, const int rwflags, struct event_set *es) +proxy_connection_io_dispatch(struct proxy_connection *pc, const unsigned int rwflags, + struct event_set *es) { const int max_transfer_per_iteration = 10000; struct proxy_connection *cp = pc->counterpart; - int rwflags_pc = pc->rwflags; - int rwflags_cp = cp->rwflags; + unsigned int rwflags_pc = pc->rwflags; + unsigned int rwflags_cp = cp->rwflags; ASSERT(pc->defined && cp->defined && cp->counterpart == pc);