From patchwork Wed Feb 1 14:15:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 3036 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:c95:b0:82:e4b3:40a0 with SMTP id p21csp452828dyk; Wed, 1 Feb 2023 06:16:01 -0800 (PST) X-Google-Smtp-Source: AK7set95mvnw1KkcM6B0QogO4ZTIl23n1E6I5E4U9glapN7paXau+NqY1lSozg+g4uJRo7dJT6f9 X-Received: by 2002:a17:902:ce0b:b0:196:3056:38f4 with SMTP id k11-20020a170902ce0b00b00196305638f4mr2941132plg.50.1675260961633; Wed, 01 Feb 2023 06:16:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675260961; cv=none; d=google.com; s=arc-20160816; b=QxwIUl3pwCPqcJAWhnUlNvRKRINmJBwkPTv3JFFXiw/SscMrq7SHGxKGg2iWpPODkq XzH6pQtHi43XpefQ96oWMa+X0gzDOHhcfeqsTi3Tj38jUGHXe/x7xE2+TFwyNQ3AuLeJ DYKQjy51uPILyuwgrR4dMTNklco+45ZMN8ggrToToySRjxZQk3l6rNnuTQVJbOHw5q9w 2+mI6ZY2IzFqzqlFVgJ7578h+7IysfVCtDdGPUMA6zvmwPzQ4GLWt+ALmC9qhXP4wsyA 71eyw2PgLajPBU//eit4J55zNom37dza2hxzGs6a1ac0P+T5bfkZOWjA+b/XhLRbXk1B zHtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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; bh=+02qZUD3MByYKCz9AiC8y3YAVSb0mA+j721q/pJdbLk=; b=C64p5WmA9IQe0XwiycmamJbsfwIjEvQR7HiLCA3npqNmAOJQnWz1VVvN3/C/y+yOE7 Pb2oyetvr7bHbyqWNA5K7JFRwU84ttmjQQtrNMK1DoofEyiB7rdsNJs63NTnwa5C4poO xn7cLMXfOOg68P0HCjWKkffTeMf/SrhSMgzNe8UWwORbeYBRY60f52WGWqO6eyP2t9ec kNNnnNUkVwGzUnMeeN54ruytj2LT0WJwxqU21l+a52li31X5OG+5iMbDzOofYETbUDd/ Sz6dbmdsS1GtCT9Qftjm5JRGSyLtMtiOEd2kUkMbYm/oGJWq9mWvH79kRxzbqM3GknHe /zfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=AVmVjKKg; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=D1C0Fxq3; 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 u13-20020a17090341cd00b00194ca747aa5si22325526ple.169.2023.02.01.06.16.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Feb 2023 06:16:01 -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=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=AVmVjKKg; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=D1C0Fxq3; 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 [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 1pNDtl-0008Kp-50; Wed, 01 Feb 2023 14:15:39 +0000 Received: from [172.30.20.202] (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 1pNDti-0008Ki-9H for openvpn-devel@lists.sourceforge.net; Wed, 01 Feb 2023 14:15:36 +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=UnNnCkcovn7D6iOnOXvgBHWe14o8aXf/d2zWkUSA53M=; b=AVmVjKKgzedW8BoQzZirLDhcDP va7tzvkQoch45E4bYoArHjFdRWlPTR23jxbpSopeASGLMI4IXAze2/3mOsahdr3KZsG09YZRqWfMz 9dslxOBWqXEiMeuiALm2VkDsEs0az0uVv+4y6YBAHpXQqHcCG4tYSsR0mwLCEV56JGNo=; 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=UnNnCkcovn7D6iOnOXvgBHWe14o8aXf/d2zWkUSA53M=; b=D1C0Fxq3Sggu05fH6Fb8pgEvqd n+U2gVzEtAhTuyFK40mnfM/QPZW14rJsNa7Q2ZB6q6nfr6ALB+Pw4XSNLLXq+tsQkR6W3UmoBD1hN QPn3g2vz7Vy75IT5c0BYonfEaovAzQg81XYSOqWaUXZzPh9h5we5O9UKOvYEj+uc6gR0=; Received: from vmail1.greenie.net ([195.30.8.66]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1pNDtb-0006oV-5J for openvpn-devel@lists.sourceforge.net; Wed, 01 Feb 2023 14:15:36 +0000 Received: from ubuntu2204.ov.greenie.net (ubuntu2204.ov.greenie.net [IPv6:2001:608:0:814:0:0:b00:24]) by vmail1.greenie.net (8.17.1/8.16.1) with SMTP id 311EFMvY047488 for ; Wed, 1 Feb 2023 15:15:22 +0100 (CET) Received: (nullmailer pid 119169 invoked by uid 1000); Wed, 01 Feb 2023 14:15:18 -0000 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Wed, 1 Feb 2023 14:15:18 +0000 Message-Id: <20230201141518.119157-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230130161730.110021-1-gert@greenie.muc.de> References: <20230130161730.110021-1-gert@greenie.muc.de> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.4 (vmail1.greenie.net [IPv6:2001:608:1:995a:20c:29ff:feb8:10eb]); Wed, 01 Feb 2023 15:15:22 +0100 (CET) X-Spam-Score: -2.0 (--) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", 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: overlapped_io_init() has a "bool tuntap_buffer" argument which is only passed onwards to alloc_buf_sock_tun(), which does nothing with it. Remove from both functions. v2: move alloc_buf_sock_tun() to win32.c Content analysis details: (-2.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.30.8.66 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-Headers-End: 1pNDtb-0006oV-5J Subject: [Openvpn-devel] [PATCH v3] Get rid of unused 'bool tuntap_buffer' arguments. 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?1756461060393478906?= X-GMAIL-MSGID: =?utf-8?q?1756638438078229842?= overlapped_io_init() has a "bool tuntap_buffer" argument which is only passed onwards to alloc_buf_sock_tun(), which does nothing with it. Remove from both functions. v2: move alloc_buf_sock_tun() to win32.c v3: leave alloc_buf_sock_tun() where it is, and fix non-WIN32 call from socket.c Signed-off-by: Gert Doering Acked-by: Arne Schwabe Message-Id: <20230130161730.110021-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26099.html Signed-off-by: Gert Doering (cherry picked from commit bdc842d72e92995261bac3579120c94f93e4064a) Acked-By: Arne Schwabe --- src/openvpn/mtu.c | 3 +-- src/openvpn/mtu.h | 3 +-- src/openvpn/socket.c | 8 +++----- src/openvpn/tun.c | 4 ++-- src/openvpn/win32.c | 5 ++--- src/openvpn/win32.h | 3 +-- 6 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/openvpn/mtu.c b/src/openvpn/mtu.c index 1d9ebe01..748a1cf1 100644 --- a/src/openvpn/mtu.c +++ b/src/openvpn/mtu.c @@ -42,8 +42,7 @@ /* allocate a buffer for socket or tun layer */ void alloc_buf_sock_tun(struct buffer *buf, - const struct frame *frame, - const bool tuntap_buffer) + const struct frame *frame) { /* allocate buffer for overlapped I/O */ *buf = alloc_buf(BUF_SIZE(frame)); diff --git a/src/openvpn/mtu.h b/src/openvpn/mtu.h index 0ff4f7bf..65236508 100644 --- a/src/openvpn/mtu.h +++ b/src/openvpn/mtu.h @@ -265,8 +265,7 @@ calc_packet_id_size_dc(const struct options *options, * allocate a buffer for socket or tun layer */ void alloc_buf_sock_tun(struct buffer *buf, - const struct frame *frame, - const bool tuntap_buffer); + const struct frame *frame); /* * EXTENDED_SOCKET_ERROR_CAPABILITY functions -- print extra error info diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index a883ac4a..42d95339 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -1623,8 +1623,8 @@ static void socket_frame_init(const struct frame *frame, struct link_socket *sock) { #ifdef _WIN32 - overlapped_io_init(&sock->reads, frame, FALSE, false); - overlapped_io_init(&sock->writes, frame, TRUE, false); + overlapped_io_init(&sock->reads, frame, FALSE); + overlapped_io_init(&sock->writes, frame, TRUE); sock->rw_handle.read = sock->reads.overlapped.hEvent; sock->rw_handle.write = sock->writes.overlapped.hEvent; #endif @@ -1637,9 +1637,7 @@ socket_frame_init(const struct frame *frame, struct link_socket *sock) sock->sockflags, sock->info.proto); #else - alloc_buf_sock_tun(&sock->stream_buf_data, - frame, - false); + alloc_buf_sock_tun(&sock->stream_buf_data, frame); stream_buf_init(&sock->stream_buf, &sock->stream_buf_data, diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 01c85f9f..20f80798 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -898,8 +898,8 @@ init_tun_post(struct tuntap *tt, return; } - overlapped_io_init(&tt->reads, frame, FALSE, true); - overlapped_io_init(&tt->writes, frame, TRUE, true); + overlapped_io_init(&tt->reads, frame, FALSE); + overlapped_io_init(&tt->writes, frame, TRUE); tt->adapter_index = TUN_ADAPTER_INDEX_INVALID; if (tt->windows_driver == WINDOWS_DRIVER_WINTUN) diff --git a/src/openvpn/win32.c b/src/openvpn/win32.c index 44176936..8cdfec0e 100644 --- a/src/openvpn/win32.c +++ b/src/openvpn/win32.c @@ -173,8 +173,7 @@ init_security_attributes_allow_all(struct security_attributes *obj) void overlapped_io_init(struct overlapped_io *o, const struct frame *frame, - BOOL event_state, - bool tuntap_buffer) /* if true: tuntap buffer, if false: socket buffer */ + BOOL event_state) { CLEAR(*o); @@ -186,7 +185,7 @@ overlapped_io_init(struct overlapped_io *o, } /* allocate buffer for overlapped I/O */ - alloc_buf_sock_tun(&o->buf_init, frame, tuntap_buffer); + alloc_buf_sock_tun(&o->buf_init, frame); } void diff --git a/src/openvpn/win32.h b/src/openvpn/win32.h index a1a45503..72ffb012 100644 --- a/src/openvpn/win32.h +++ b/src/openvpn/win32.h @@ -217,8 +217,7 @@ struct overlapped_io { void overlapped_io_init(struct overlapped_io *o, const struct frame *frame, - BOOL event_state, - bool tuntap_buffer); + BOOL event_state); void overlapped_io_close(struct overlapped_io *o);