From patchwork Thu Jul 2 02:52:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1198 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director7.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id 2PYLINLY/V5PDwAAIUCqbw for ; Thu, 02 Jul 2020 08:53:38 -0400 Received: from proxy7.mail.ord1d.rsapps.net ([172.30.191.6]) by director7.mail.ord1d.rsapps.net with LMTP id aDroH9LY/V7uUwAAovjBpQ ; Thu, 02 Jul 2020 08:53:38 -0400 Received: from smtp15.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy7.mail.ord1d.rsapps.net with LMTP id wIkPH9LY/V5JfgAAMe1Fpw ; Thu, 02 Jul 2020 08:53:38 -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: smtp15.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=rfc2549.org X-Suspicious-Flag: YES X-Classification-ID: 0bc926ee-bc63-11ea-9896-5254007ab6c8-1-1 Received: from [216.105.38.7] ([216.105.38.7:42312] helo=lists.sourceforge.net) by smtp15.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 7D/17-27736-1D8DDFE5; Thu, 02 Jul 2020 08:53:38 -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 1jqyhp-00015L-Bt; Thu, 02 Jul 2020 12:52:45 +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 1jqyhk-00014g-JL for openvpn-devel@lists.sourceforge.net; Thu, 02 Jul 2020 12:52:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc: 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=0SlIWToi84cd4Gtwf1UCYuhQX3pF0/uZlZEQci4hngY=; b=m4jBajoN9mzgEfJqzi5uUfMVef NWv5mUviVFPpa11EnDgkOr9I0a7ALDdmniqMaxAtW+bIhiZ648hFyWuMbu9Y8uYy5ByfPKzuGFzn6 I53yshhWNIc2h8WCSEnZAkiEzdivjRDzfGRR2W/ZgvRNcK+9vBFVVgDkJaDEDTT/4UfY=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc: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=0SlIWToi84cd4Gtwf1UCYuhQX3pF0/uZlZEQci4hngY=; b=Kx8pyxGhXEttSqucg/NWgpMryJ G7jVXuoJEHcW5u+FAN0H5Lhf4fRVSD0ODXGJvKjhxUbKLr7WRfg51EQGsJAZTa68DHizVcEMd4v7j vgNDV9rGP8c3kLBP6nK+0+RGsRVHBYp+rBuhmEr3ohDuuWqLoIXFOKxZTYdW47WZG8Kw=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1jqyhg-005RWN-B2 for openvpn-devel@lists.sourceforge.net; Thu, 02 Jul 2020 12:52:38 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.92.3 (FreeBSD)) (envelope-from ) id 1jqyhU-0009LF-Es for openvpn-devel@lists.sourceforge.net; Thu, 02 Jul 2020 14:52:24 +0200 Received: (nullmailer pid 13563 invoked by uid 10006); Thu, 02 Jul 2020 12:52:24 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Thu, 2 Jul 2020 14:52:24 +0200 Message-Id: <20200702125224.13516-1-arne@rfc2549.org> X-Mailer: git-send-email 2.17.1 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: rfc2549.org] 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Headers-End: 1jqyhg-005RWN-B2 Subject: [Openvpn-devel] [PATCH] Remove push_reply_deferred variable 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 The variable has no useful function (anymore?). There is only one place where this variable was checked else if (!c->c2.push_reply_deferred && c->c2.context_auth == CAS_SUCCEEDED) This condition also depends on context_auth == CAS_SUCCEEDED but the only code path that sets context_auth = CAS_SUCCEEDED also sets push_reply_deferred = false; Signed-off-by: Arne Schwabe Acked-by: Lev Stipakov --- src/openvpn/multi.c | 7 ------- src/openvpn/openvpn.h | 1 - src/openvpn/push.c | 2 +- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 95b16744..138701a9 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -828,8 +828,6 @@ multi_create_instance(struct multi_context *m, const struct mroute_addr *real) mi->did_cid_hash = true; #endif - mi->context.c2.push_reply_deferred = true; - #ifdef ENABLE_ASYNC_PUSH mi->context.c2.push_request_received = false; mi->inotify_watch = -1; @@ -2109,11 +2107,6 @@ script_failed: gc_free(&gc); } - - /* - * Reply now to client's PUSH_REQUEST query - */ - mi->context.c2.push_reply_deferred = false; } #ifdef ENABLE_ASYNC_PUSH diff --git a/src/openvpn/openvpn.h b/src/openvpn/openvpn.h index 1afc3a92..4609af3e 100644 --- a/src/openvpn/openvpn.h +++ b/src/openvpn/openvpn.h @@ -432,7 +432,6 @@ struct context_2 #if P2MP /* --ifconfig endpoints to be pushed to client */ - bool push_reply_deferred; #ifdef ENABLE_ASYNC_PUSH bool push_request_received; #endif diff --git a/src/openvpn/push.c b/src/openvpn/push.c index 369cd6a4..56d652a3 100644 --- a/src/openvpn/push.c +++ b/src/openvpn/push.c @@ -803,7 +803,7 @@ process_incoming_push_request(struct context *c) send_auth_failed(c, client_reason); ret = PUSH_MSG_AUTH_FAILURE; } - else if (!c->c2.push_reply_deferred && c->c2.context_auth == CAS_SUCCEEDED) + else if (c->c2.context_auth == CAS_SUCCEEDED) { time_t now;