From patchwork Sun Sep 8 22:57:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lev Stipakov X-Patchwork-Id: 819 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director12.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id +O61DU0Udl36NgAAIUCqbw for ; Mon, 09 Sep 2019 04:58:53 -0400 Received: from proxy20.mail.ord1d.rsapps.net ([172.30.191.6]) by director12.mail.ord1d.rsapps.net with LMTP id AG2FDU0Udl2zWQAAIasKDg ; Mon, 09 Sep 2019 04:58:53 -0400 Received: from smtp38.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy20.mail.ord1d.rsapps.net with LMTP id qFlaDU0Udl3PDwAAsk8m8w ; Mon, 09 Sep 2019 04:58:53 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp38.gate.ord1d.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=gmail.com; dmarc=fail (p=none; dis=none) header.from=gmail.com X-Suspicious-Flag: YES X-Classification-ID: 0bd7646a-d2e0-11e9-b05e-525400f6a58b-1-1 Received: from [216.105.38.7] ([216.105.38.7:54326] helo=lists.sourceforge.net) by smtp38.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 9B/B1-04511-C44167D5; Mon, 09 Sep 2019 04:58:53 -0400 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.90_1) (envelope-from ) id 1i7FUO-0003tf-EE; Mon, 09 Sep 2019 08:57:36 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1i7FUL-0003tW-Ju for openvpn-devel@lists.sourceforge.net; Mon, 09 Sep 2019 08:57:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding: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=Xp/Qj0ec7Xga4ZVoCKYO6r7RLElmoezwsZuQxke9W6I=; b=O2ZFyzxbf2GBjTXAiZAXZDVb30 5ef1/n7XL+51NEBeDyZI81iLYbzxmNOgoqVRyXgpJjJfi2/iAiWSlLJBHEs9XRE29C4ATyPeCkdQ4 pD6d8uAP00OmlU2yCTiMxpRBhNW2qerZzeUCJlOqrWqL8o8ds07xoTlBv8xMyE1YXoJQ=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:MIME-Version: Content-Type:Content-Transfer-Encoding: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=Xp/Qj0ec7Xga4ZVoCKYO6r7RLElmoezwsZuQxke9W6I=; b=hKHNialM+UpbOBNngeFzaZbo+i sMPnbppYyxuCZXydG9qFHpldPQNGlU6OXPeIIGByls8du0QuACqnJLHv/5KKRtO1aP8RnNnwgWGJe DBa0upxier67ctisbj0WW70UgRAOSrtNgi6xGk3xRqFXtL/AYJ3d1gNHZ87/oxrO61Ew=; Received: from mail-wm1-f49.google.com ([209.85.128.49]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) id 1i7FUK-005VG2-AB for openvpn-devel@lists.sourceforge.net; Mon, 09 Sep 2019 08:57:33 +0000 Received: by mail-wm1-f49.google.com with SMTP id g207so12814110wmg.5 for ; Mon, 09 Sep 2019 01:57:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=Xp/Qj0ec7Xga4ZVoCKYO6r7RLElmoezwsZuQxke9W6I=; b=T3N/OVIBkbQVhPCJEJFenhNCh5takIiUiZ0lUjZopUWpqHns42/chgluSnOu6oV4sr iU83jQjSTBl+PRfqhAPQ644PlS5aDy5XPpfaPcNR5swGNfTDHDQUP8j7kEtIN3P1RH9r iSixY2BMk4FCEIgwB1fVJ19VhLisO1FUVxkhov897JuNfLI17DBsEfA9wkw6kmDQWU5w XU/YSAcxHghRLTevu6S6gBBl5sGOSPMQXTjYRA3aXa94z/PEsjl4CkHAtVk1yodogzR2 jCcyeYUUjQ+prB8ngzKBdng1hXw8phwOjec3b0FPLUNxsiLvnw/XiNlfDSMaqX5T38wA Wp0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=Xp/Qj0ec7Xga4ZVoCKYO6r7RLElmoezwsZuQxke9W6I=; b=DNQYVQn1VCv7LtVnigl6akWTbxc8ddUuE++VUfZcAs9vhCi7HZHVIUPkRGvaVOr3mq PY+SCgEFzJ8lysEhqfeD0U93xgJgV8BrLm9W4rz4wh/ebCkrYs9M+iXMKGkGoBH5L97b /vz8Pkt7LmEPqDE9MdVxEp0kucZDlANyqKAnmuWTKRc/8Av5C2yyuKBn7hvuvozK00p9 b0h1oojxHPlGMlSmy7KlleAQK3wzmNhQ76wgEIwMOqS+KoRlvG5ixbg21ZIptwLxwF9i h05Favy+zsF57OdQYe3LqI2kISIhlO+ZTptdp7qxJY5rUKuel1bnkZsSdhtR8ohT7BJ2 ADkg== X-Gm-Message-State: APjAAAUKsyKT37TQ74FW9YHUpHmWC5s5L1lPE663fu5a4SySGVrrnb/s Z7z415L5AUTUlD8irXSZAISNO8DEY0M= X-Google-Smtp-Source: APXvYqyj2VZy4GJrDRJAM0fcnIE6J3Ei6caUwE41mJQ8oQY8usn1IXat8F6ZXnpCcER2nTP06BRgTA== X-Received: by 2002:a1c:9988:: with SMTP id b130mr18800885wme.164.1568019445312; Mon, 09 Sep 2019 01:57:25 -0700 (PDT) Received: from stipakov.fi (stipakov.fi. [128.199.52.117]) by smtp.gmail.com with ESMTPSA id w12sm19781708wrg.47.2019.09.09.01.57.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Sep 2019 01:57:24 -0700 (PDT) From: Lev Stipakov To: openvpn-devel@lists.sourceforge.net Date: Mon, 9 Sep 2019 11:57:16 +0300 Message-Id: <1568019436-28527-1-git-send-email-lstipakov@gmail.com> X-Mailer: git-send-email 2.7.4 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (lstipakov[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.128.49 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1i7FUK-005VG2-AB Subject: [Openvpn-devel] [PATCH] tun.h: remove TUN_PASS_BUFFER define 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: , MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox Since the very beginning this define has only been used together with _WIN32 and code wrapped into it uses Win32 API, so it could be safely removed and replaced with _WIN32. Signed-off-by: Lev Stipakov Acked-By: David Sommerseth --- src/openvpn/forward.c | 4 ++-- src/openvpn/tun.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/openvpn/forward.c b/src/openvpn/forward.c index c2dcb53..8451706 100644 --- a/src/openvpn/forward.c +++ b/src/openvpn/forward.c @@ -1256,7 +1256,7 @@ read_incoming_tun(struct context *c) perf_push(PERF_READ_IN_TUN); c->c2.buf = c->c2.buffers->read_tun_buf; -#ifdef TUN_PASS_BUFFER +#ifdef _WIN32 read_tun_buffered(c->c1.tuntap, &c->c2.buf); #else ASSERT(buf_init(&c->c2.buf, FRAME_HEADROOM(&c->c2.frame))); @@ -1877,7 +1877,7 @@ process_outgoing_tun(struct context *c) &c->c2.n_trunc_tun_write); #endif -#ifdef TUN_PASS_BUFFER +#ifdef _WIN32 size = write_tun_buffered(c->c1.tuntap, &c->c2.to_tun); #else size = write_tun(c->c1.tuntap, BPTR(&c->c2.to_tun), BLEN(&c->c2.to_tun)); diff --git a/src/openvpn/tun.h b/src/openvpn/tun.h index 69831c4..c8f08e2 100644 --- a/src/openvpn/tun.h +++ b/src/openvpn/tun.h @@ -336,8 +336,6 @@ route_order(void) #ifdef _WIN32 -#define TUN_PASS_BUFFER - struct tap_reg { const char *guid;