From patchwork Fri Apr 16 03:35:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1746 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director14.mail.ord1d.rsapps.net ([172.28.255.1]) by backend30.mail.ord1d.rsapps.net with LMTP id YAOqM+CSeWBiHQAAIUCqbw (envelope-from ) for ; Fri, 16 Apr 2021 09:36:32 -0400 Received: from proxy8.mail.ord1c.rsapps.net ([172.28.255.1]) by director14.mail.ord1d.rsapps.net with LMTP id mBp0M+CSeWBUXwAAeJ7fFg (envelope-from ) for ; Fri, 16 Apr 2021 09:36:32 -0400 Received: from smtp7.gate.ord1c ([172.28.255.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy8.mail.ord1c.rsapps.net with LMTPS id CBc6M+CSeWAgVAAAHz/atg (envelope-from ) for ; Fri, 16 Apr 2021 09:36:32 -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: smtp7.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; dmarc=none (p=nil; dis=none) header.from=rfc2549.org X-Suspicious-Flag: YES X-Classification-ID: c141fbd0-9eb8-11eb-9a37-bc305bf04148-1-1 Received: from [216.105.38.7] ([216.105.38.7:36130] helo=lists.sourceforge.net) by smtp7.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id C7/2D-07265-0E299706; Fri, 16 Apr 2021 09:36:32 -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 1lXOd9-0002YE-Qj; Fri, 16 Apr 2021 13:35:31 +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 1lXOd8-0002Y6-29 for openvpn-devel@lists.sourceforge.net; Fri, 16 Apr 2021 13:35:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: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=VwWFPvTSUjpZTvQdGIk0QkLGOdtVkNaSnzdPEJLkTio=; b=advJ8wQNey30Sv5hGu0i2Jp9vo c/eeaX982U46F6RPJ773PMlRA21wbRQsHj5X/hmqlt5zljqfkoV5yLceL+lVuQ9G4rFQNOFAEWwqM F7KTfSN+8QUIquWTdHfzyjjm1Y+vN6ZAAHoO5h9aN0spp8QMvsrfoTT0KTkNqqNcxkz4=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:To:From: Sender:Reply-To:Cc:Content-Type: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=VwWFPvTSUjpZTvQdGIk0QkLGOdtVkNaSnzdPEJLkTio=; b=M OEoSoQhuKeKp56cm7UnnQ6O7ff02HWL2YEc4QOdiH+ofE6cwcZySWbA4Z0D8K6XA2Wg8gSxSWjS5B oG9sO2PQNdLJ1OqWZQgHprwySOSOnnrP1PFzHuC67JWuIPoqM+HavbKbI0kSN99M5hsSalO7SooUJ CxnACpjJpSJFhaoY=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1lXOd3-00FS4S-Om for openvpn-devel@lists.sourceforge.net; Fri, 16 Apr 2021 13:35:30 +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 1lXOcp-000NUi-S7 for openvpn-devel@lists.sourceforge.net; Fri, 16 Apr 2021 15:35:11 +0200 Received: (nullmailer pid 1176916 invoked by uid 10006); Fri, 16 Apr 2021 13:35:12 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Fri, 16 Apr 2021 15:35:12 +0200 Message-Id: <20210416133512.1176870-1-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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: 1lXOd3-00FS4S-Om Subject: [Openvpn-devel] [PATCH] Also restore/save route-gatreway options in reconnects 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: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox Signed-off-by: Arne Schwabe Acked-by: Gert Doering --- src/openvpn/options.c | 6 ++++++ src/openvpn/options.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 5934b0b84..10078a4d6 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -3571,6 +3571,9 @@ pre_connect_save(struct options *o) o->pre_connect->client_nat_defined = true; } + o->pre_connect->route_default_gateway = o->route_default_gateway; + o->pre_connect->route_ipv6_default_gateway = o->route_ipv6_default_gateway; + /* NCP related options that can be overwritten by a push */ o->pre_connect->ciphername = o->ciphername; o->pre_connect->authname = o->authname; @@ -3619,6 +3622,9 @@ pre_connect_restore(struct options *o, struct gc_arena *gc) o->routes_ipv6 = NULL; } + o->route_default_gateway = pp->route_default_gateway; + o->route_ipv6_default_gateway = pp->route_ipv6_default_gateway; + if (pp->client_nat_defined) { cnol_check_alloc(o); diff --git a/src/openvpn/options.h b/src/openvpn/options.h index ee3fd7e50..ef59f0a99 100644 --- a/src/openvpn/options.h +++ b/src/openvpn/options.h @@ -70,6 +70,9 @@ struct options_pre_connect bool routes_ipv6_defined; struct route_ipv6_option_list *routes_ipv6; + const char *route_default_gateway; + const char *route_ipv6_default_gateway; + bool client_nat_defined; struct client_nat_option_list *client_nat;