From patchwork Wed Jul 3 04:50:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kaldor X-Patchwork-Id: 774 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director12.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id 2FeCG/fHHF2jHAAAIUCqbw for ; Wed, 03 Jul 2019 11:21:27 -0400 Received: from proxy13.mail.iad3b.rsapps.net ([172.31.255.6]) by director12.mail.ord1d.rsapps.net with LMTP id MFwYFffHHF15dAAAIasKDg ; Wed, 03 Jul 2019 11:21:27 -0400 Received: from smtp16.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy13.mail.iad3b.rsapps.net with LMTP id COfSBvfHHF1GRwAAvUvv+w ; Wed, 03 Jul 2019 11:21:27 -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: smtp16.gate.iad3b.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=tunnelbear-com.20150623.gappssmtp.com; dmarc=fail (p=none; dis=none) header.from=tunnelbear.com X-Suspicious-Flag: YES X-Classification-ID: 388eec36-9da6-11e9-b907-5254004ed364-1-1 Received: from [216.105.38.7] ([216.105.38.7:47254] helo=lists.sourceforge.net) by smtp16.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id D0/32-26026-5F7CC1D5; Wed, 03 Jul 2019 11:21:25 -0400 Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1hih3E-00050E-Ud; Wed, 03 Jul 2019 15:20:04 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1hih3D-000504-Fb for openvpn-devel@lists.sourceforge.net; Wed, 03 Jul 2019 15:20:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:To:Subject:Message-ID:Date:From: MIME-Version:Sender:Reply-To:Cc: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=l4c/fv5Ugz/L4nwQbu9JdCyftfv4RWV0OQWL3zzYu6o=; b=OpSXEvtqCkmnlNp6bwwZWdWlXo pMQDpAhgaYBv7dPdVSROIPsvoQ4+9+2o8y8dBL+YHT0mKpRCgCUsKdPVVB4/C1hZ0GVkhDhhexq+E N4hghzR1YlhlrbH5YeHXUQgJFkoQloq38nnSOVRK4oT70zFtolLiIphCSLez1ZXi8F5s=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:To:Subject:Message-ID:Date:From:MIME-Version:Sender:Reply-To :Cc: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=l4c/fv5Ugz/L4nwQbu9JdCyftfv4RWV0OQWL3zzYu6o=; b=H SgOb69Tsz7sKscqv6tT9b1qNJTR22CtMnInNbxXL6gM/fvNGUQNWM7Pk9yP6I9KQmMXvndNqwuI2G ift0QcYLgRpZjotviX3TjnvJlG5rBI4mrqT7Dxo6DwfndlFYmGP6bUBXOYo7kOODJwyw8Qt2C0Lm7 aQYSR6JpPu1sKncs=; Received: from mail-qt1-f196.google.com ([209.85.160.196]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) id 1hih3L-006pCx-N4 for openvpn-devel@lists.sourceforge.net; Wed, 03 Jul 2019 15:20:13 +0000 Received: by mail-qt1-f196.google.com with SMTP id i34so1618057qta.6 for ; Wed, 03 Jul 2019 08:20:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tunnelbear-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=l4c/fv5Ugz/L4nwQbu9JdCyftfv4RWV0OQWL3zzYu6o=; b=Juxq80mNLselvPDQVFYEn3b1BM3z57xTbxdAYqyAzoI+09r8gr6QKkW6BblaH7huxz anhlXHHZcCQitAEnFOxS+9mNP0y4NjQ+4owDwXHix3cWvQhOO1xnr1rO8jUyryubh2TH xLvPh8lFmPREiO6vvcTtr/KMPpeBPbm90z1mEfiDf0jM40LBv6iZoEuUl0dYtxptUUOw bg7ufAk0zX0l0+pgfltimdBV+Xxp6Mrkc/X3UjiVtxz9rTiOM1wuPX3nZB/QPjCIv1kn a81JlxAaNadPxXVYhA8TcC2zZzC62dJGa06FXbIOUWJ29MsS8Xf9RAykl0gMzqM0AVrO +lvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=l4c/fv5Ugz/L4nwQbu9JdCyftfv4RWV0OQWL3zzYu6o=; b=dnzTxrWons7eyPI925VIIEYWOmoKHw+iOWCaBVtZAdyPuwJGdVJdvfdZ3EPJ+FKzMd u/WRNSX4FkqLxGVcH+sYf6OnlIY3a7d/BPwIm58YwCwu8J4ve9HKvoh09H0vP1JjJAi1 0EXM0LQRmug62N0y3hPIAolGAy+LhOsmTCAiLwqGIlrn7uqyYJEnKrN56JKd2h20qpPI eBU0UHUndJG6+ZezcTFl+d5yvuE6ZCE4+9vNRsBueporztMgYWo9c18Df2kWyDGol6Xl /Bo0Ub4VJNvrwSauwXSq73rkw39DoGXq8yzMShmD9XokHDtu6ac43wFzTBph+LfTQA3s esEQ== X-Gm-Message-State: APjAAAXFqEsbh3iIo5eHLELURQP7nfBmFw/SPpEkhBdWwY3tQuTnPJEN XOB/7jzM3yhn5IbfEXJA3Rcja3b4m/uUVCxb0IYspkasejVHD5xb X-Google-Smtp-Source: APXvYqycQpDJYuUfdT/T2dW3h5ksZI87VW9bPXEAnOv4J1H8rr9u+rH2uGYcqfnwjUH1mMmJaWDo6hIe/jXP8cGt3oY= X-Received: by 2002:ac8:24e3:: with SMTP id t32mr31099644qtt.104.1562165452407; Wed, 03 Jul 2019 07:50:52 -0700 (PDT) MIME-Version: 1.0 From: Daniel Kaldor Date: Wed, 3 Jul 2019 15:50:41 +0100 Message-ID: To: openvpn-devel@lists.sourceforge.net X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.196 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.160.196 listed in wl.mailspike.net] -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 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 RCVD_IN_MSPIKE_WL Mailspike good senders X-Headers-End: 1hih3L-006pCx-N4 Subject: [Openvpn-devel] [PATCH 1/1] Exit management interface loop early on receiving 'remote MOD' message. 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 OpenVPN using management interface and running with 'management-query-remote' in the config will wait for a 'remote MOD' or 'remote ACCEPT' message before continuing with connection. Logs indicate that this stage of the connection process currently takes ~1s to complete. This seems to be because the management interface polling loop is being run once unnecessarily after receiving 'remote MOD' message, and is only exiting after 1s timeout is reached on final polling loop. This change exits the polling loop early, immediately after receiving 'remote MOD' message and removes 1s delay in connection. --- src/openvpn/manage.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) man_check_for_signals(&signal_received); -- 2.9.3 (Apple Git-75) diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c index 2d86dad..7343e8b 100644 --- a/src/openvpn/manage.c +++ b/src/openvpn/manage.c @@ -3348,7 +3348,13 @@ management_event_loop_n_seconds(struct management *man, int sec) /* run command processing event loop */ do { - man_standalone_event_loop(man, &signal_received, expire); + int status = -1; + + status = man_standalone_event_loop(man, &signal_received, expire); + if (status > 0) + { + return; + } if (!signal_received) {