From patchwork Mon Jul 6 06:35:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1203 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director10.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id ED56LRJTA181RAAAIUCqbw for ; Mon, 06 Jul 2020 12:36:34 -0400 Received: from proxy9.mail.ord1d.rsapps.net ([172.30.191.6]) by director10.mail.ord1d.rsapps.net with LMTP id cJIWLRJTA1+iCAAApN4f7A ; Mon, 06 Jul 2020 12:36:34 -0400 Received: from smtp37.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy9.mail.ord1d.rsapps.net with LMTP id gJUcLRJTA1+BIAAA7h+8OQ ; Mon, 06 Jul 2020 12:36:34 -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: smtp37.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: da80346e-bfa6-11ea-8008-525400a11cf3-1-1 Received: from [216.105.38.7] ([216.105.38.7:51426] helo=lists.sourceforge.net) by smtp37.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id BB/DE-32273-213530F5; Mon, 06 Jul 2020 12:36:34 -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 1jsU5n-000750-0L; Mon, 06 Jul 2020 16:35:43 +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 1jsU5l-00074t-M3 for openvpn-devel@lists.sourceforge.net; Mon, 06 Jul 2020 16:35:41 +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=bHwfTRBRLseSVL5n8ECZ/hRKOaSjQSH9l8TRaERO7OA=; b=UHC9mIa8gj9UQbRvYKl+qtIGEl ohr2d59utTjat6N1S7Ka4FSKmZf1empPsXLivnxj0ArE83EK8MRz3d+MkPg3Iotr5wJwBv+27/z9e RziwY0gX0Os/vH4locknEV6FtvIrN3/qxMISwU3j6UahWnEV8nwSOVRacDr5z/GXH9Sg=; 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=bHwfTRBRLseSVL5n8ECZ/hRKOaSjQSH9l8TRaERO7OA=; b=YA8kgSa+S7tx9exDxL8eLOvccB wY0aFJvpwVvEHBe1Oagfbmoayfhg8hmE6AZ1Aht/T50KS2bJ485mcosFqeqN7L5Ie8mnNWyScFdqQ 6OjAZsYt+ZLUScz2QXz0A3lQ4Q26ce5lYc1SDOixYHs73gIePNAe1Y83OagFCdQxwfWw=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1jsU5b-00CRI3-Hb for openvpn-devel@lists.sourceforge.net; Mon, 06 Jul 2020 16:35:41 +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 1jsU5N-000G6O-2c for openvpn-devel@lists.sourceforge.net; Mon, 06 Jul 2020 18:35:17 +0200 Received: (nullmailer pid 11439 invoked by uid 10006); Mon, 06 Jul 2020 16:35:16 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Mon, 6 Jul 2020 18:35:15 +0200 Message-Id: <20200706163516.11390-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.2 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 -0.1 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1jsU5b-00CRI3-Hb Subject: [Openvpn-devel] [PATCH 1/2] Remember if we have seen a push request without async push 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 logic if we already have seen a push request is still correct/useful without async push. I am not entirely sure if also deferred management authentication can trigger this code path but it should be able to. The other benefit is removing a number of ifdefs. Signed-off-by: Arne Schwabe --- src/openvpn/multi.c | 4 +--- src/openvpn/openvpn.h | 2 -- src/openvpn/push.c | 2 -- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index f1ced9b7..f6be6618 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -824,8 +824,8 @@ multi_create_instance(struct multi_context *m, const struct mroute_addr *real) mi->did_cid_hash = true; #endif -#ifdef ENABLE_ASYNC_PUSH mi->context.c2.push_request_received = false; +#ifdef ENABLE_ASYNC_PUSH mi->inotify_watch = -1; #endif @@ -2074,13 +2074,11 @@ script_failed: /* set context-level authentication flag */ mi->context.c2.context_auth = CAS_SUCCEEDED; -#ifdef ENABLE_ASYNC_PUSH /* authentication complete, send push reply */ if (mi->context.c2.push_request_received) { process_incoming_push_request(&mi->context); } -#endif } else { diff --git a/src/openvpn/openvpn.h b/src/openvpn/openvpn.h index 4609af3e..a1308852 100644 --- a/src/openvpn/openvpn.h +++ b/src/openvpn/openvpn.h @@ -432,9 +432,7 @@ struct context_2 #if P2MP /* --ifconfig endpoints to be pushed to client */ -#ifdef ENABLE_ASYNC_PUSH bool push_request_received; -#endif bool push_ifconfig_defined; time_t sent_push_reply_expiry; in_addr_t push_ifconfig_local; diff --git a/src/openvpn/push.c b/src/openvpn/push.c index 56d652a3..e7c3c08c 100644 --- a/src/openvpn/push.c +++ b/src/openvpn/push.c @@ -794,9 +794,7 @@ process_incoming_push_request(struct context *c) { int ret = PUSH_MSG_ERROR; -#ifdef ENABLE_ASYNC_PUSH c->c2.push_request_received = true; -#endif if (tls_authentication_status(c->c2.tls_multi, 0) == TLS_AUTHENTICATION_FAILED || c->c2.context_auth == CAS_FAILED) { const char *client_reason = tls_client_reason(c->c2.tls_multi);