From patchwork Wed Feb 5 01:46:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Domagoj Pensa X-Patchwork-Id: 973 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director9.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id GCD0APa8Ol5xTQAAIUCqbw for ; Wed, 05 Feb 2020 08:02:46 -0500 Received: from proxy8.mail.ord1d.rsapps.net ([172.30.191.6]) by director9.mail.ord1d.rsapps.net with LMTP id YAPiAPa8Ol4AEQAAalYnBA ; Wed, 05 Feb 2020 08:02:46 -0500 Received: from smtp3.gate.ord1c ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy8.mail.ord1d.rsapps.net with LMTP id cAJCAPa8Ol5rBQAAGdz6CA ; Wed, 05 Feb 2020 08:02:46 -0500 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: smtp3.gate.ord1c.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; dmarc=none (p=nil; dis=none) header.from=pensa.hr X-Suspicious-Flag: YES X-Classification-ID: ccf4b614-4817-11ea-95fa-842b2b47481a-1-1 Received: from [216.105.38.7] ([216.105.38.7:55260] helo=lists.sourceforge.net) by smtp3.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id B4/56-26457-5FCBA3E5; Wed, 05 Feb 2020 08:02:45 -0500 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 1izKJV-0000Yq-KA; Wed, 05 Feb 2020 13:01:53 +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 1izKJU-0000Yh-Cw for openvpn-devel@lists.sourceforge.net; Wed, 05 Feb 2020 13:01:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Date:Subject:Message-ID:To:From:Sender:Reply-To:Cc: 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=fiSfnLfAQKPhEAuwy0Lo30FTPLQtRF6RQCftB4QyObg=; b=NCqGeKXXZJZ60+f6DPjlxB2Qux dRK8MQIP51OV/XJw+17oey6fa44xbqiKlg/gGhFdF4tS5THZbreFfhE7bSs7gW8Hyt9bcWJp4ce2q OKRjnZ8HEG5K+Kwl6FqwSVNMT06MZSur6tHvM4e/QvW50pVSuB2RelGy52Ai7u4mDNAQ=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Date:Subject:Message-ID:To:From:Sender:Reply-To:Cc: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=fiSfnLfAQKPhEAuwy0Lo30FTPLQtRF6RQCftB4QyObg=; b=H+vOeUGdDIake6zlJe6cpOaq4m NZO877Yi3/eMVbqg+vpeFE2Qv5jIti0u9GG+aEI4p8/rSNNy6KVCTRkj2XkrI/GLXPK1Cdxmlc48h 1ZlfJ0VRO6GsNgz4MG+YpqvquhdcjK011VOiOmZ0ePiBL+9/65W5cdLfjT135jqO54L4=; Received: from sender4-of-o51.zoho.com ([136.143.188.51]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) (Exim 4.92.2) id 1izKJT-000AxR-3d for openvpn-devel@lists.sourceforge.net; Wed, 05 Feb 2020 13:01:52 +0000 Received: from localhost (31-38.dsl.iskon.hr [89.164.31.38]) by mx.zohomail.com with SMTPS id 1580906782300505.4699948723347; Wed, 5 Feb 2020 04:46:22 -0800 (PST) From: Domagoj Pensa To: openvpn-devel@lists.sourceforge.net Message-ID: <20200205124615.15758-2-domagoj@pensa.hr> Date: Wed, 5 Feb 2020 13:46:14 +0100 X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200205124615.15758-1-domagoj@pensa.hr> References: <20200205124615.15758-1-domagoj@pensa.hr> MIME-Version: 1.0 X-ZohoMailClient: External X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: pensa.hr] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Headers-End: 1izKJT-000AxR-3d Subject: [Openvpn-devel] [PATCH 1/2] Skip DNS address validation 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 When adding IPv4 DNS servers without interactive service use "validate=no", on Windows 7 and higher, to skip time consuming automatic address validation, that is on by default. Fix uses adapted code from commit 786e06a Signed-off-by: Domagoj Pensa Acked-by: Lev Stipakov Acked-by: Simon Rozman --- src/openvpn/tun.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index af09e676..9f369f74 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -5216,6 +5216,7 @@ netsh_ifconfig_options(const char *type, struct gc_arena gc = gc_new(); struct argv argv = argv_new(); bool delete_first = false; + bool is_dns = !strcmp(type, "dns"); /* first check if we should delete existing DNS/WINS settings from TAP interface */ if (test_first) @@ -5259,6 +5260,14 @@ netsh_ifconfig_options(const char *type, type, flex_name, print_in_addr_t(addr_list[i], 0, &gc)); + + /* disable slow address validation on Windows 7 and higher */ + /* only for DNS */ + if (is_dns && win32_version_info() >= WIN_7) + { + argv_printf_cat(&argv, "%s", "validate=no"); + } + netsh_command(&argv, 2, M_FATAL); ++count;