| Message ID | 20201215173950.26596-1-domagoj@pensa.hr |
|---|---|
| State | Superseded |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net> 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 yMKNI0r12F/gYAAAIUCqbw (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) for <patchwork@openvpn.net>; Tue, 15 Dec 2020 12:41:30 -0500 Received: from proxy10.mail.ord1d.rsapps.net ([172.30.191.6]) by director9.mail.ord1d.rsapps.net with LMTP id INY7I0r12F+bDgAAalYnBA (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) for <patchwork@openvpn.net>; Tue, 15 Dec 2020 12:41:30 -0500 Received: from smtp29.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy10.mail.ord1d.rsapps.net with LMTPS id 8IsfI0r12F8sXQAAfSg8FQ (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) for <patchwork@openvpn.net>; Tue, 15 Dec 2020 12:41:30 -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: smtp29.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; dmarc=none (p=nil; dis=none) header.from=pensa.hr X-Suspicious-Flag: YES X-Classification-ID: c2e70ce4-3efc-11eb-a9a1-525400f257a9-1-1 Received: from [216.105.38.7] ([216.105.38.7:53656] helo=lists.sourceforge.net) by smtp29.gate.ord1d.rsapps.net (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id A3/F3-03513-945F8DF5; Tue, 15 Dec 2020 12:41:29 -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 <openvpn-devel-bounces@lists.sourceforge.net>) id 1kpEJR-00012o-SX; Tue, 15 Dec 2020 17:40:37 +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 <domagoj@pensa.hr>) id 1kpEJ9-00011p-5P for openvpn-devel@lists.sourceforge.net; Tue, 15 Dec 2020 17:40:19 +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 :Date:Subject:Message-ID:Cc:To:From:Sender:Reply-To: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=+g6SFpjg9eyUFckRSrIoOgv5ymp/6pp1PipLfMOSSbo=; b=mnEGtF9TnFp0p5Bq7lIkoWtyMA adEz8efX203UKuISe94q8cey6N+IBc/vydas3ZK6nsO6c0HSkejJVmMmbux8iJNRRMy3XRJQocAR2 b47mLdjIFPBFDz/P+uukyonVrgk21ewCIPXaMTa7crnvau9l8ZcM+1mYUVoLvMIi8J/Q=; 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:Date:Subject: Message-ID:Cc:To:From:Sender:Reply-To: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=+g6SFpjg9eyUFckRSrIoOgv5ymp/6pp1PipLfMOSSbo=; b=kwSofHg6bILAhCU7es7Fnt4m7I s8Kw2CCcIBDFiBk4Y8aWE4CA09aXsi6iZKpbvlNX4zOATKKdIBzSGA/x1jgfCmArg4+w5nRkQlV81 lnRkuQjIvWSAQaSM1tbTnGAWBVyTrGWbO9azLMCUhIcJBjV1oimkL0dQVGA4NKrZIQ+k=; Received: from sender4-of-o50.zoho.com ([136.143.188.50]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1kpEJ0-00EZT5-2W for openvpn-devel@lists.sourceforge.net; Tue, 15 Dec 2020 17:40:19 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1608053995; cv=none; d=zohomail.com; s=zohoarc; b=RiumIfQimvdlejYPRrsVQ/aM9E81bw1AJFOrMigwBiZTk5nCDU7BRxBVNuTvpMEk9QiqBrGR+QsTJTkjSivQOTr/gcfm8cpgUX1X4vgigRqAPATzi3xOIpsW5Sl21cgjUX7GkqD4Yq41oDciclr72Nj8NLy+e/3aN7Y+NZ27nGo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608053995; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=+g6SFpjg9eyUFckRSrIoOgv5ymp/6pp1PipLfMOSSbo=; b=Niq0S1AjMc5ea1Ds3TFgo3ibmC6alj3bFnbe/1udrYQUeRSqgZ1ngfz/HaEeycsGqsrhefOkZxUuQEQAGhTxIfeLePmEo2ZafhWKl8EoeF4OybImTcOmek73IKAPn9knBClCZzk8wRNPwTjLlbZbTqeeP7Ot+Fj4IEmUWXdfjmI= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass smtp.mailfrom=domagoj@pensa.hr; dmarc=pass header.from=<domagoj@pensa.hr> header.from=<domagoj@pensa.hr> Received: from localhost (21-233.dsl.iskon.hr [89.164.21.233]) by mx.zohomail.com with SMTPS id 1608053992795858.4348844007524; Tue, 15 Dec 2020 09:39:52 -0800 (PST) From: Domagoj Pensa <domagoj@pensa.hr> To: openvpn-devel@lists.sourceforge.net Message-ID: <20201215173950.26596-1-domagoj@pensa.hr> Date: Tue, 15 Dec 2020 18:39:50 +0100 X-Mailer: git-send-email 2.29.2 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 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [136.143.188.50 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.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [136.143.188.50 listed in wl.mailspike.net] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Headers-End: 1kpEJ0-00EZT5-2W Subject: [Openvpn-devel] [PATCH] Remove 1 second delay before running netsh X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: <openvpn-devel.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel> List-Post: <mailto:openvpn-devel@lists.sourceforge.net> List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help> List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe> Cc: Domagoj Pensa <domagoj@pensa.hr> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox |
| Series |
[Openvpn-devel] Remove 1 second delay before running netsh
|
|
Commit Message
Domagoj Pensa
Dec. 15, 2020, 6:39 a.m. UTC
When running various netsh commands before each 1 second sleep is added.
As more netsh commands are run, especially for Wintun adapters, that can
add to a noticable delayed connecting time.
This should be safe. No problems were found in tests and all netsh
commands executed properly with delay removed. Also, no delays are used
in a similar code in interactive service and netsh command executions
are guarded with a semaphore.
Signed-off-by: Domagoj Pensa <domagoj@pensa.hr>
---
src/openvpn/tun.c | 1 -
1 file changed, 1 deletion(-)
Comments
Hi, On Tue, Dec 15, 2020 at 06:39:50PM +0100, Domagoj Pensa wrote: > When running various netsh commands before each 1 second sleep is added. > As more netsh commands are run, especially for Wintun adapters, that can > add to a noticable delayed connecting time. > > This should be safe. No problems were found in tests and all netsh > commands executed properly with delay removed. Also, no delays are used > in a similar code in interactive service and netsh command executions > are guarded with a semaphore. This is... interesting. The offending sleep(1) was added there by james, 15 years ago, in commit a9c802b2a (imported from SVN) That commit basically split the "sleep(5) after each try" into "sleep(1) before and sleep(4) after", so possibly it was needed before the very first netsh call... The change itself is not commented in the commit message, so we can only guess commit a9c802b2a3f77f2b906e22f582681cdec0790c32 Author: James Yonan <james@openvpn.net> Date: Thu Dec 22 18:09:40 2005 +0000 --ip-win32 adaptive is now the default. --ip-win32 netsh (or --ip-win32 adaptive when in netsh mode) can now set DNS/WINS addresses on the TAP-Win32 adapter. Lev: do you have a particular opinion on this change? You do more testing with wintun... gert
Hi, > Lev: do you have a particular opinion on this change? You do more > testing with wintun... Wintun uses iservice where we don't have those delays. I tend to agree with Vladislav (themiron), let's use management_sleep(0) which processes any pending actions on the management interface without any wait. -Lev
Hi! I've sent a new patch that uses management_sleep(0) instead. I've also added your explanation why management_sleep(0) is used. Regards, Domagoj On Mon, Dec 21, 2020 at 10:06:57AM +0200, Lev Stipakov wrote: > Hi, > > > Lev: do you have a particular opinion on this change? You do more > > testing with wintun... > > Wintun uses iservice where we don't have those delays. > > I tend to agree with Vladislav (themiron), let's use management_sleep(0) which > processes any pending actions on the management interface without any wait. > > -Lev
diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 400a50ca..e9f1aadb 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -5207,7 +5207,6 @@ netsh_command(const struct argv *a, int n, int msglevel) for (i = 0; i < n; ++i) { bool status; - management_sleep(1); netcmd_semaphore_lock(); argv_msg_prefix(M_INFO, a, "NETSH"); status = openvpn_execve_check(a, NULL, 0, "ERROR: netsh command failed");