From patchwork Mon Mar 19 18:03:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selva Nair X-Patchwork-Id: 275 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director10.mail.ord1d.rsapps.net ([172.28.255.1]) by backend30.mail.ord1d.rsapps.net (Dovecot) with LMTP id kydhN32WsFoHXwAAIUCqbw for ; Tue, 20 Mar 2018 01:05:01 -0400 Received: from director7.mail.ord1c.rsapps.net ([172.28.255.1]) by director10.mail.ord1d.rsapps.net (Dovecot) with LMTP id m4VfN32WsFqFUwAApN4f7A ; Tue, 20 Mar 2018 01:05:01 -0400 Received: from smtp4.gate.ord1c ([172.28.255.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by director7.mail.ord1c.rsapps.net with LMTP id eB/mNn2WsFovHwAAqdfm7w ; Tue, 20 Mar 2018 01:05:01 -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: smtp4.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; 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: 3e0b3ab0-2bfc-11e8-8949-0024e87f2f2c-1-1 Received: from [216.105.38.7] ([216.105.38.7:65336] helo=lists.sourceforge.net) by smtp4.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.1.56364 r(Core:4.2.1.14)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 34/09-28166-D7690BA5; Tue, 20 Mar 2018 01:05:01 -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 1ey9RH-0005ZD-FU; Tue, 20 Mar 2018 05:03:59 +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 1ey9RF-0005Z7-UG for openvpn-devel@lists.sourceforge.net; Tue, 20 Mar 2018 05:03:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: 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=YNLmjbBhVICVZRWWV2CJVT8JjrFF1FvHPrGLmk3Sxp4=; b=GtSLVJc85EKHSFOAJkZFGsdip6 R4AUhKZVB4WOvG3Xdk7zQIVBkFGokK5VApEk86zOcBlsN2vERqILiS+BJqW7exh1IsqJrm0CsDQw9 lc4IIpkDub3cs0Vrz5Y/0PqF+oKulZSnY1QTiZYrns160gm5t1Z9GugeSeIp9pfcP9YE=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: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=YNLmjbBhVICVZRWWV2CJVT8JjrFF1FvHPrGLmk3Sxp4=; b=S7D7WIzPjWkZGFU2xtJBOTFwf0 uwpL4YYTVW20y21f/iWTL24yUO4+P5zaJzcb6HmiMUFWVxB/medIcZT5vhQS6Mw6XcHw3h+05yS8B UGRxAThHBqlKk2jM+6KQKw2vDKdQ4FEhrljIwyLdCXTKNoum7GtcNdfhUf2LBlLFnTvM=; Received: from sfi-lb-mx.v20.lw.sourceforge.com ([172.30.20.201] helo=mail-it0-f68.google.com) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) id 1ey9RE-00FNlk-26 for openvpn-devel@lists.sourceforge.net; Tue, 20 Mar 2018 05:03:57 +0000 Received: by mail-it0-f68.google.com with SMTP id e195-v6so724344ita.5 for ; Mon, 19 Mar 2018 22:03:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=YNLmjbBhVICVZRWWV2CJVT8JjrFF1FvHPrGLmk3Sxp4=; b=Hy4VX2V75gqcYmNIbY145Gwq0N7eNwhT6nthO5KG3yexSPMtJdV+YXudM/QgOqK9Uq y4blhp1BZMkp0XOiiZxoDGOdWvO8LeVcmEKGrR5gcnXmgxuOjiRbv2miMY8bNTuvUZpk 0Ci+fAPiU12sw37E5JIerP+QGL+Ni8zXW2vQkifYYhts8/jjMAGUe3FMLIsrtnK88UQU w1Gg31lwwijy+RmyUfKlql29zF395LTyVljD71LLDKEa7amCSGwc3ybomA0DC3nMev/m oT9GHjVezvBe5tpLWi/fydNCwUNnAqJPzwNdVjPTcmucbmXyeeDeA+8XC350KMd78GVU Dlvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=YNLmjbBhVICVZRWWV2CJVT8JjrFF1FvHPrGLmk3Sxp4=; b=jRO+0X+YYcWmsY3wdo/CPz918rB+E0VA5jBp4GdsOT2XcuOUDNmd/Bs3OfOppmCwdj lmz0NQ2d82GZZbhxunpRtZ/vuueMh4JNa0WAYp55v2TS3/DL6Udqk0xY25pQx2Y/Zv4y /rHpXQxx6rRHmdkk59gxX9mNtEoek1AnPP22Hy/jNFPKYQZDme5GpbgIhWwUl3atNUGM O9+lgVHZkmvWC9LFKOwIQIdLx8wKwRVGm4c6eLdqc83mA3VzqvToP1BXU1vYhYBKTabY H9Kl7Dbuea0IeAG1nyQgJZN7hyQ5TD3kMQXAx5e1+4ViwKwMW6IjQcTLA+K5hHlrca2s xUBg== X-Gm-Message-State: AElRT7FdjbCAeA2G8vgD6274Ge0qj5clU0EdOFn3aEL7U5OA+KsOKTzA zuFg0f2VHTJfH0HVjbrorhM/FObf X-Google-Smtp-Source: AG47ELsFaEnSn7C81ijwF0U/Z4RjDmmJBp/yCLkHDbDHgWEcIdtuIThjcLP7nL75WVZ7rAEtXitZbA== X-Received: by 2002:a24:32c4:: with SMTP id j187-v6mr1276593ita.85.1521522230248; Mon, 19 Mar 2018 22:03:50 -0700 (PDT) Received: from saturn.home.sansel.ca (CPE40167ea0e1c2-CM788df74daaa0.cpe.net.cable.rogers.com. [99.228.215.92]) by smtp.gmail.com with ESMTPSA id m67sm430417iod.74.2018.03.19.22.03.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Mar 2018 22:03:49 -0700 (PDT) From: selva.nair@gmail.com To: openvpn-devel@lists.sourceforge.net Date: Tue, 20 Mar 2018 01:03:43 -0400 Message-Id: <1521522224-18829-1-git-send-email-selva.nair@gmail.com> X-Mailer: git-send-email 2.1.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 (selva.nair[at]gmail.com) 3.6 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [99.228.215.92 listed in zen.spamhaus.org] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1ey9RE-00FNlk-26 Subject: [Openvpn-devel] [PATCH 1/2] Persist management-query-remote and proxy prompts 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 From: Selva Nair Currently this prompt is only output once, not re-written to the management interface when the management client connects. It is thus not seen by a client that connects after the prompt is output or one that disconnects and reconnects. This leads to a deadlock: the daemon waiting for the "remote" command from the client, the latter not aware of it. Resolve by adding the ">REMOTE" and ">PROXY" prompt to man.persist.special_state_msg as done for other persisted prompts such as ">PASSWORD" Signed-off-by: Selva Nair --- This is a bug fix so could go into 2.4 and master. src/openvpn/init.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/openvpn/init.c b/src/openvpn/init.c index 36c1a4c..413563a 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -269,6 +269,7 @@ ce_management_query_proxy(struct context *c) buf_printf(&out, ">PROXY:%u,%s,%s", (l ? l->current : 0) + 1, (proto_is_udp(ce->proto) ? "UDP" : "TCP"), np(ce->remote)); management_notify_generic(management, BSTR(&out)); + management->persist.special_state_msg = BSTR(&out); } ce->flags |= CE_MAN_QUERY_PROXY; while (ce->flags & CE_MAN_QUERY_PROXY) @@ -280,6 +281,7 @@ ce_management_query_proxy(struct context *c) break; } } + management->persist.special_state_msg = NULL; gc_free(&gc); } @@ -349,6 +351,7 @@ ce_management_query_remote(struct context *c) buf_printf(&out, ">REMOTE:%s,%s,%s", np(ce->remote), ce->remote_port, proto2ascii(ce->proto, ce->af, false)); management_notify_generic(management, BSTR(&out)); + management->persist.special_state_msg = BSTR(&out); ce->flags &= ~(CE_MAN_QUERY_REMOTE_MASK << CE_MAN_QUERY_REMOTE_SHIFT); ce->flags |= (CE_MAN_QUERY_REMOTE_QUERY << CE_MAN_QUERY_REMOTE_SHIFT); @@ -362,6 +365,7 @@ ce_management_query_remote(struct context *c) break; } } + management->persist.special_state_msg = NULL; } gc_free(&gc); From patchwork Mon Mar 19 18:03:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selva Nair X-Patchwork-Id: 274 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 (Dovecot) with LMTP id 66lHNX2WsFrOdQAAIUCqbw for ; Tue, 20 Mar 2018 01:05:01 -0400 Received: from proxy3.mail.ord1d.rsapps.net ([172.30.191.6]) by director9.mail.ord1d.rsapps.net (Dovecot) with LMTP id j6AlBX2WsFoDVgAAalYnBA ; Tue, 20 Mar 2018 01:05:01 -0400 Received: from smtp10.gate.ord1c ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy3.mail.ord1d.rsapps.net with LMTP id KNgGNX2WsFpJNwAA7WKfLA ; Tue, 20 Mar 2018 01:05:01 -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: smtp10.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; 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: 3e1ddad0-2bfc-11e8-8809-0026b954785f-1-1 Received: from [216.105.38.7] ([216.105.38.7:60510] helo=lists.sourceforge.net) by smtp10.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.1.56364 r(Core:4.2.1.14)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id E8/50-25765-D7690BA5; Tue, 20 Mar 2018 01:05:01 -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 1ey9RL-0001An-B9; Tue, 20 Mar 2018 05:04:03 +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 1ey9RK-0001Ah-0K for openvpn-devel@lists.sourceforge.net; Tue, 20 Mar 2018 05:04:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: 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=8oGpJPiXPu2OlryrmPr249ITGxgtqwcIApCSkFsVH6g=; b=LRceLAmGxLRhXlW4f7whCbrSOw 7eet+VJFndGON0jRUVdDukXE+k62sv1Hksn0Yv5RMuuKL8MG0zKmgVWLlth7y7WpAzo/TDBY2nDT4 YP3CutAtdKNQF1vTm4rULPV7kuoA5F1jV/tlfP1OzuS/EwyeaJRmM2p8uLnIxlP7u+oE=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To :MIME-Version:Content-Type:Content-Transfer-Encoding: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=8oGpJPiXPu2OlryrmPr249ITGxgtqwcIApCSkFsVH6g=; b=BDzMrYoVuXvA+JHMMrNSokjXRz 2NfynmgJtLwZ4liWWF44RsPw7U0VA/2omBC0jwxlP8tXD60NIsUKQb+8sTt/T2TIGda9/PHaoVQ/L Mw13kqBBwj+vF35RhscTaAC8nMpwadUQoSOHqEJk+Z2wusJ4mE1qqrQp9Nu75T7d+FiY=; Received: from sfi-lb-mx.v20.lw.sourceforge.com ([172.30.20.201] helo=mail-it0-f65.google.com) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) id 1ey9RI-000jp4-Hg for openvpn-devel@lists.sourceforge.net; Tue, 20 Mar 2018 05:04:01 +0000 Received: by mail-it0-f65.google.com with SMTP id d13-v6so747117itf.0 for ; Mon, 19 Mar 2018 22:04:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8oGpJPiXPu2OlryrmPr249ITGxgtqwcIApCSkFsVH6g=; b=qQTohgMMN8ypiVQgQmwebfA5CcjOJk8qUrBYCirddaPRKZED0ZPTvGv670g/3AEQCE C/uerjZcpMDhrmIPF6xWCgxQA7G1Pinn1OE9aRXXuYpDfyATfV2b692Yfs7nsGdSADZv ukIDEeP9iCCTFE9KcOrlrCVEte5r45MYYV3koSNWUITKR2zSRYH7JiV6wDOb9ckVmF+S W52hTlHjo6aVJ6QJbYngEXR98wMRIPM3Xv/QGO2T65LR/p+uYTKVnPhqYrIe/ywuw8Zf mkDxTuq70DWD5ZXpsV+1AKZgSD1PDacBK1Wikc1rmRSCc/N39GBCheGXR4l9llHttrbs QF2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8oGpJPiXPu2OlryrmPr249ITGxgtqwcIApCSkFsVH6g=; b=tiQ/yVCjoLIAlN1DZr40DismGFEmTxtC73q9/7zrna8L5nQfrQn9YpOArlJ1IXS8X1 rd3naYcJLkU3vAEa484X5IZ5tJbXR3fMWJsXQA4sfgP97SQO9h4m/9UPxgWWcGq8BWGh qPc1Qx6UreXiuCW4yfO4vQDoA21ainA7Re0tYg0IuZ1xG53OXZMM6K1EPRc84rBexQgw STHnCzHhS1qbYbL7qpk+FA3vcVhl4QYv6/E/rP4pMZ26vEjcCOTpSDoFtmAtp1rDmfbQ luYJ2ugoBPOVkFysgbS4zM3tAflGsOe4dMtOss01n1qu4Gqj2VD1R2BoQzqhoK+Je3o0 pDKw== X-Gm-Message-State: AElRT7EecEL/2zQpLBaToozq3fGHLiqnC+PAgmIvG/3pGhMqDknyh350 QFgJx+DANX0HmFaKOiCVfJSZD8VT X-Google-Smtp-Source: AG47ELv8Don2/BGevuSvkTFTJeHd80SSgTbXMKYcqCueBJ9hC4iuNMh+sMoen40tAZW/9juNKwJxaQ== X-Received: by 2002:a24:41cd:: with SMTP id b74-v6mr1239712itd.27.1521522234857; Mon, 19 Mar 2018 22:03:54 -0700 (PDT) Received: from saturn.home.sansel.ca (CPE40167ea0e1c2-CM788df74daaa0.cpe.net.cable.rogers.com. [99.228.215.92]) by smtp.gmail.com with ESMTPSA id m67sm430417iod.74.2018.03.19.22.03.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Mar 2018 22:03:54 -0700 (PDT) From: selva.nair@gmail.com To: openvpn-devel@lists.sourceforge.net Date: Tue, 20 Mar 2018 01:03:44 -0400 Message-Id: <1521522224-18829-2-git-send-email-selva.nair@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1521522224-18829-1-git-send-email-selva.nair@gmail.com> References: <1521522224-18829-1-git-send-email-selva.nair@gmail.com> X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 3.6 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [99.228.215.92 listed in zen.spamhaus.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (selva.nair[at]gmail.com) 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1ey9RI-000jp4-Hg Subject: [Openvpn-devel] [PATCH 2/2] Allow repeated cycles through remotes when management-query-remote is in use 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 From: Selva Nair (i) Let the management-client predictably cycle through remote entries. This is done by not aborting after two cycles. The client can abort or restart the connection using signals (USR/HUP/TERM) as necessary. In the current behaviour, the daemon can unexpectedly exit when the last remote is skipped. When management-query-remote is not in use, the behaviour is unchanged. (ii) Do not count skipping a remote as an unsuccessful connection attempt. As the latter count is used for backoff it should count only failed attempts. Signed-off-by: Selva Nair --- src/openvpn/init.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/openvpn/init.c b/src/openvpn/init.c index 413563a..c63dc67 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -468,14 +468,6 @@ next_connection_entry(struct context *c) c->c1.link_socket_addr.remote_list; } - /* - * Increase the number of connection attempts - * If this is connect-retry-max * size(l) - * OpenVPN will quit - */ - - c->options.unsuccessful_attempts++; - if (++l->current >= l->len) { @@ -501,6 +493,9 @@ next_connection_entry(struct context *c) { /* allow management interface to override connection entry details */ ce_defined = ce_management_query_remote(c); + + /* ignore cycles when management-query-remote is in use */ + n_cycles = 0; if (IS_SIG(c)) { break; @@ -517,6 +512,7 @@ next_connection_entry(struct context *c) #endif } while (!ce_defined); + c->options.unsuccessful_attempts++; /* Check if this connection attempt would bring us over the limit */ if (c->options.connect_retry_max > 0 && c->options.unsuccessful_attempts > (l->len * c->options.connect_retry_max))