From patchwork Wed Mar 17 05:00:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1619 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director7.mail.ord1d.rsapps.net ([172.27.255.57]) by backend30.mail.ord1d.rsapps.net with LMTP id 2NzaGusnUmD0AQAAIUCqbw (envelope-from ) for ; Wed, 17 Mar 2021 12:01:47 -0400 Received: from proxy20.mail.iad3a.rsapps.net ([172.27.255.57]) by director7.mail.ord1d.rsapps.net with LMTP id 4H25GusnUmD2aAAAovjBpQ (envelope-from ) for ; Wed, 17 Mar 2021 12:01:47 -0400 Received: from smtp39.gate.iad3a ([172.27.255.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy20.mail.iad3a.rsapps.net with LMTPS id eLwSE+snUmC4EQAAtfLT2w (envelope-from ) for ; Wed, 17 Mar 2021 12:01:47 -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: smtp39.gate.iad3a.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: 1243fc5e-873a-11eb-bd73-525400eea4e4-1-1 Received: from [216.105.38.7] ([216.105.38.7:56068] helo=lists.sourceforge.net) by smtp39.gate.iad3a.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id CA/73-21930-9E722506; Wed, 17 Mar 2021 12:01:46 -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.92.3) (envelope-from ) id 1lMYbN-0002o5-79; Wed, 17 Mar 2021 16:00:53 +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.92.3) (envelope-from ) id 1lMYbK-0002nv-Pt for openvpn-devel@lists.sourceforge.net; Wed, 17 Mar 2021 16:00:50 +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: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:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=A2QhbEt2j60FVTXFgiQVvU8ciIzgiK30yQv9EYQCkD0=; b=VHdVZZCiq0AMpIdIPLpsvznW2k B0bAvoG1DHd/tpjJ/q4vJFqazs2XVwM6d9OIy1Uz5WYm6amQoCE6Z2qbyoNO9TYXxSN3lS5cTK6Q2 ZAGw8cpa9gt9oYg9Yonn/Vph2JB7q02RaclKUKxHx5xWaHywCYfvqMrgh2UaNdcHAhdY=; 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: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:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=A2QhbEt2j60FVTXFgiQVvU8ciIzgiK30yQv9EYQCkD0=; b=d7v/bwTmtbFD3m5UrLSbJv13A6 TAowrHB9nMOsv+PHC0DIarmdD5JebSmHhDBgtSlU1xgvljZdcy6KFT/c0H8po28rrOhT+SsaWxEn5 VCQHQ3SP7TjXdXPWuVvRUB+AHS8dj0D7tYJCQiYmXSgn6RH2QFboR8wLnC+FskMK3xq0=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1lMYbF-0004wM-Pt for openvpn-devel@lists.sourceforge.net; Wed, 17 Mar 2021 16:00:50 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.94 (FreeBSD)) (envelope-from ) id 1lMYb8-000GKa-O7 for openvpn-devel@lists.sourceforge.net; Wed, 17 Mar 2021 17:00:38 +0100 Received: (nullmailer pid 25880 invoked by uid 10006); Wed, 17 Mar 2021 16:00:38 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Wed, 17 Mar 2021 17:00:38 +0100 Message-Id: <20210317160038.25828-3-arne@rfc2549.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210317160038.25828-1-arne@rfc2549.org> References: <20210317160038.25828-1-arne@rfc2549.org> 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.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 X-Headers-End: 1lMYbF-0004wM-Pt Subject: [Openvpn-devel] [PATCH v2 3/3] Restore also ping related options on a reconnect 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 This fixes the issue that if a client reconnects the next connection entries inherits the keepalive settings that were pushed or set by the previous entry. Since UDP+PULL entries have an implicit 120s timeout, this timeout also got applied to a TCP session after an UDP entry. Patch v2: rebase on master Reported-By: Jan Just Keijser Signed-off-by: Arne Schwabe Acked-by: Antonio Quartulli --- src/openvpn/options.c | 9 +++++++++ src/openvpn/options.h | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 645fc38b..42681b71 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -3540,6 +3540,11 @@ pre_pull_save(struct options *o) o->pre_pull->ciphername = o->ciphername; o->pre_pull->authname = o->authname; o->pre_pull->keysize = o->keysize; + + /* Ping related options should be reset to the config values on reconnect */ + o->pre_pull->ping_rec_timeout = o->ping_rec_timeout; + o->pre_pull->ping_rec_timeout_action = o->ping_rec_timeout_action; + o->pre_pull->ping_send_timeout = o->ping_send_timeout; } } @@ -3591,6 +3596,10 @@ pre_pull_restore(struct options *o, struct gc_arena *gc) o->ciphername = pp->ciphername; o->authname = pp->authname; o->keysize = pp->keysize; + + o->ping_rec_timeout = pp->ping_rec_timeout; + o->ping_rec_timeout_action = pp->ping_rec_timeout_action; + o->ping_send_timeout = pp->ping_send_timeout; } o->push_continuation = 0; diff --git a/src/openvpn/options.h b/src/openvpn/options.h index fe67ec72..5317a60e 100644 --- a/src/openvpn/options.h +++ b/src/openvpn/options.h @@ -79,6 +79,10 @@ struct options_pre_pull const char* authname; int keysize; + int ping_send_timeout; + int ping_rec_timeout; + int ping_rec_timeout_action; + int foreign_option_index; };