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);