From patchwork Thu Dec 24 00:59:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Domagoj Pensa X-Patchwork-Id: 1556 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director8.mail.ord1d.rsapps.net ([172.28.255.1]) by backend30.mail.ord1d.rsapps.net with LMTP id MO9KE+aC5F+sOQAAIUCqbw (envelope-from ) for ; Thu, 24 Dec 2020 07:00:38 -0500 Received: from proxy1.mail.ord1c.rsapps.net ([172.28.255.1]) by director8.mail.ord1d.rsapps.net with LMTP id KMMaE+aC5F/5FQAAfY0hYg (envelope-from ) for ; Thu, 24 Dec 2020 07:00:38 -0500 Received: from smtp25.gate.ord1c ([172.28.255.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy1.mail.ord1c.rsapps.net with LMTPS id qCjWEuaC5F/OagAA2VeTtA (envelope-from ) for ; Thu, 24 Dec 2020 07:00:38 -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: smtp25.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: a0f02d2a-45df-11eb-9db0-b8ca3a673c88-1-1 Received: from [216.105.38.7] ([216.105.38.7:47348] helo=lists.sourceforge.net) by smtp25.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 52/DB-30106-2E284EF5; Thu, 24 Dec 2020 07:00:35 -0500 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1ksPHQ-0005sh-7X; Thu, 24 Dec 2020 11:59:40 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ksPHO-0005sO-Ph for openvpn-devel@lists.sourceforge.net; Thu, 24 Dec 2020 11:59:38 +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:To:From:Sender:Reply-To:Cc: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=w+patxhGKZaTb8OGp4FcGZcjn1KuGxaewVC9QFsxfCE=; b=h4V16lxkiKdmNzI4uU7l1qaS9f 5bJ6XqN59Xbc+jyaifgncfHNkRRPr8woYmXdeLlOJk1vS06pxffMKm+WrbzjfQstm/OOl8pj8CeGO c7sSVnLfuV4JwOsq2lBRuqrZ3kzSxpJ9L1QrgxGrJcQNyVNu+GoxOzpwZJkIjhwtt9lQ=; 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:To:From:Sender:Reply-To:Cc: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=w+patxhGKZaTb8OGp4FcGZcjn1KuGxaewVC9QFsxfCE=; b=JR/tAkkMsSot43Sv71TmdvobiQ Y+XI0uCK8Lyw8IT3opmMsMFKk9d8Prup/QmOA19KJ8bICdoZBbHXBtZaO2EzBGktzlAo/BUi2NqKu AbnOZ54/n+FerhIxULTsfd5s4d31Ta2GkyYYBagVHrenho/knbXxK46g9xU+s8UPDWhs=; 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 1ksPHF-00B4Sy-0l for openvpn-devel@lists.sourceforge.net; Thu, 24 Dec 2020 11:59:38 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1608811155; cv=none; d=zohomail.com; s=zohoarc; b=JXfrpCofWLv1Ei/qddKNv81EHZ06pmgUOeztIi/7UEW3rP6Rz8ZjmMJzWLHgdl0llDAgdWezR4FHPX0tW+kSkcbUqpG8TZ4rkMaxUwTNiwjRpkUt5Z8jQzkijc6dSh7jO4aYt9ULHYEW+OOLzQe3xJ4bQx/swoIUC4Rhwr4A+DU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608811155; h=Content-Type:Content-Transfer-Encoding:Date:From:MIME-Version:Message-ID:Subject:To; bh=w+patxhGKZaTb8OGp4FcGZcjn1KuGxaewVC9QFsxfCE=; b=AkYih93uWbWsZKvmLVW0M3nuOdCOIVblJVoVeAb0THGH0gwp2gioZKQoZCkIxA9PcwsvKQ4CAlNHHfbhoHVIgJyYr7KOIcLwKDSelwiSE9U8B/2AaliganMb/+zBbY3cLiynJWifSNrzOhPEuHl2zyq4qpn+JCI8uNfwM6SELxk= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass smtp.mailfrom=domagoj@pensa.hr; dmarc=pass header.from= header.from= Received: from localhost (33-6.dsl.iskon.hr [89.164.33.6]) by mx.zohomail.com with SMTPS id 1608811153075778.732360483414; Thu, 24 Dec 2020 03:59:13 -0800 (PST) From: Domagoj Pensa To: openvpn-devel@lists.sourceforge.net Message-ID: <20201224115910.10129-1-domagoj@pensa.hr> Date: Thu, 24 Dec 2020 12:59:10 +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 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [136.143.188.50 listed in wl.mailspike.net] -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_WL Mailspike good senders X-Headers-End: 1ksPHF-00B4Sy-0l Subject: [Openvpn-devel] [PATCH v2] Remove 1 second delay before running netsh 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 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. Instead of removing management_sleep(1), management_sleep(0) is used as a replacement to allow processing any pending actions on the management interface without any wait. Signed-off-by: Domagoj Pensa Acked-by: Lev Stipakov --- src/openvpn/tun.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 400a50ca..0751ae46 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -5207,7 +5207,7 @@ netsh_command(const struct argv *a, int n, int msglevel) for (i = 0; i < n; ++i) { bool status; - management_sleep(1); + management_sleep(0); netcmd_semaphore_lock(); argv_msg_prefix(M_INFO, a, "NETSH"); status = openvpn_execve_check(a, NULL, 0, "ERROR: netsh command failed");