From patchwork Mon Jan 30 14:41:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 3024 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:c95:b0:82:e4b3:40a0 with SMTP id p21csp3302346dyk; Mon, 30 Jan 2023 07:16:41 -0800 (PST) X-Google-Smtp-Source: AK7set/oKoPep5mUcir/BwAtZXlG20qR6VR0td+JpMWDpPyUw37cuiQ4mOdmL4visCdkFSD19p5i X-Received: by 2002:a05:6102:4188:b0:3e8:7ab3:84b7 with SMTP id cd8-20020a056102418800b003e87ab384b7mr13645548vsb.28.1675091801040; Mon, 30 Jan 2023 07:16:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675091801; cv=none; d=google.com; s=arc-20160816; b=vGo9In1/J6Bn8GpH42Teu3icdjAGpxYSRsq3Me0HU+r6dDM+3IYbo1EG63/6H6UDH4 JQ7qZ5wQEHLoySpHHrrP1OvBD8Hk/4tUfL8BpU7I8WTaILVsVGNWisykP7hDwBOWVN2h u5RaGIfWt3HEAYNu/CxjVY5IiLIgcSrXBfeT0U68rTgpujsL04Fxpt7FDsTL4h2kAcyK 39t7DAtNrHTrvim4HBM9CR+IreEWXkVakMIiFk85XPEXZACGd0YHXfCl15R7uX2crtH1 7EeN5+T7lnZHPsw60xarJaiTGLJlHodF/qHzt04E7ppLh0GUTIxLiTlIa2LTZXouOP2h pU0g== 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:message-id:date:to:from:dkim-signature:dkim-signature; bh=A8+gwn8JzA4IFqwgTtTg8Te1NHrrcfv2+51l72Usiac=; b=gRl/wwqQEYUwgltKao0SsK0VVtLVpekmt5RXfQwH5cGaHgJyXFyECcZZXKzVQ4a6d/ eAc3MkNYroks8Nx7wSwMshfylRG89uTJ/OIvhDr/8DIKwffoVcz1JxCv4UBz8maQY9tp iPbC6UPI3AJjQY87M1HkIQdTSO74y5C1JXkpU+VdvXNvppoEgfG2HpyBtP3d4EDeQVHV ge2aduV213Yu7vV9HprZx2xERby+77/s4lwEtcJWwLS87J07ev/EdEQfPgBY0/3kmUKt jjFMJzOzs+Yp0QzhctJ4Uv1nOr1SJibBn/6BADZfGxIO+OZbKyeBTTnUs6vwN8OqK/l0 B70w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=janTXIn7; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=V992Keyl; 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 e3-20020ab01683000000b006301bca5c9fsi3516219uaf.178.2023.01.30.07.16.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jan 2023 07:16:41 -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=janTXIn7; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=V992Keyl; 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 1pMVtD-0002kI-9A; Mon, 30 Jan 2023 15:16:09 +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 1pMVtA-0002kA-KX for openvpn-devel@lists.sourceforge.net; Mon, 30 Jan 2023 15:16:07 +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: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:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=8B3ExcOsFV99k1UkLWv9Ibzvd+HR1Ngz4JAEvgZHG7k=; b=janTXIn7Km3DaPrBVcQdV5ulYc 9W8Sez2u//pQ/NJ+ywqxXpKUFpWEiF0CWcCoSVipp2rPg5MLXHPkgqWQR7xWS76ojLvPhFMA2/3B6 fkMmRX69+QejVSgLM3Hzz9lavMB9qM0cnk5cCOp0SMfvzK3oINpFR4pcsOa98/vMwTUI=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version: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:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=8B3ExcOsFV99k1UkLWv9Ibzvd+HR1Ngz4JAEvgZHG7k=; b=V 992Keylo4W1VQtIrxpEhBcFIZt+0gTNEPOjixsoWWNQ5Ba4uQrN0/uA9otWKAees3EZMiCrPnRPch 7FvAxrdf5m5KN8uIN3iGfSIXah/CXs1eyglikl1+owWKvK1RUkcX9x6iV+xlGVkchCorT4XQIU3kP 5l6aU/rA+vkkdlGQ=; Received: from vmail1.greenie.net ([195.30.8.66]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1pMVt3-003ptU-HT for openvpn-devel@lists.sourceforge.net; Mon, 30 Jan 2023 15:16:07 +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 30UEfCFR075430 for ; Mon, 30 Jan 2023 15:41:12 +0100 (CET) Received: (nullmailer pid 109572 invoked by uid 1000); Mon, 30 Jan 2023 14:41:12 -0000 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Mon, 30 Jan 2023 14:41:12 +0000 Message-Id: <20230130144112.109560-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.34.1 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]); Mon, 30 Jan 2023 15:41:12 +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. Signed-off-by: Gert Doering --- src/openvpn/mtu.c | 3 +-- src/openvpn/mtu.h | 3 +-- src/openvpn/socket.c | 4 ++-- src/openvpn/tun.c | 4 ++-- src/openvpn/win32.c | 5 ++--- src/ope [...] 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: 1pMVt3-003ptU-HT Subject: [Openvpn-devel] [PATCH] 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?1756461060393478906?= 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. Signed-off-by: Gert Doering --- src/openvpn/mtu.c | 3 +-- src/openvpn/mtu.h | 3 +-- src/openvpn/socket.c | 4 ++-- src/openvpn/tun.c | 4 ++-- src/openvpn/win32.c | 5 ++--- src/openvpn/win32.h | 3 +-- 6 files changed, 9 insertions(+), 13 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..2c75cb35 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 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);