From patchwork Sat Aug 13 10:42:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 2672 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director12.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id kPoxDAgN+GKlAwAAIUCqbw (envelope-from ) for ; Sat, 13 Aug 2022 16:43:52 -0400 Received: from proxy2.mail.ord1d.rsapps.net ([172.30.191.6]) by director12.mail.ord1d.rsapps.net with LMTP id KGwUDAgN+GJMVQAAIasKDg (envelope-from ) for ; Sat, 13 Aug 2022 16:43:52 -0400 Received: from smtp30.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy2.mail.ord1d.rsapps.net with LMTPS id oAD5CwgN+GI9XwAAfawv4w (envelope-from ) for ; Sat, 13 Aug 2022 16:43:52 -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: smtp30.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; dkim=fail (signature verification failed) header.d=unstable.cc; dmarc=fail (p=none; dis=none) header.from=unstable.cc X-Suspicious-Flag: YES X-Classification-ID: a3805b56-1b48-11ed-b5ef-5254001e8e38-1-1 Received: from [216.105.38.7] ([216.105.38.7:49480] helo=lists.sourceforge.net) by smtp30.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id C2/C4-16273-70D08F26; Sat, 13 Aug 2022 16:43:51 -0400 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1oMxyG-0005ml-Iz; Sat, 13 Aug 2022 20:43:00 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oMxyE-0005mW-FU for openvpn-devel@lists.sourceforge.net; Sat, 13 Aug 2022 20:42:58 +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:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: 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=u9s0BNYaUWvlgmsJLfIkIqiFiItTeiiWcmTSEreepAc=; b=KGLk4bixmVwujSRPvfPuW3XknD Lrdr/vMqr42gjuY2x0cr4UbrMCJdm3332QJYPIfBRMXykRH6zo7iSPfQhq8/ccC9lGzMTVIlaTYxA gDvksrnPa5z2NeUTk1gxt0/rEj/dTzBVlsZ8OytAQBcPqCh9E58Cuq2tIr0QR4n6nIjU=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: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=u9s0BNYaUWvlgmsJLfIkIqiFiItTeiiWcmTSEreepAc=; b=VBiUKtlyOW97eR8UAkpA+2yX/N yCBdMQB0LfSSd4yMmro9qxLFgDiqG47kTg2YxtE8+LuIHnPtb3B/MtSBBIzOIyCuSrh+GYs4oILqx 6nskwFrXwVu3przgENG/Lf8xqKgOM9f4LeLVjxFVRzu4FdrGAEtcMk47LpFcFjQop1Ns=; Received: from wilbur.contactoffice.com ([212.3.242.68]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1oMxy7-0004cf-7i for openvpn-devel@lists.sourceforge.net; Sat, 13 Aug 2022 20:42:58 +0000 Received: from smtpauth2.co-bxl (smtpauth2.co-bxl [10.2.0.24]) by wilbur.contactoffice.com (Postfix) with ESMTP id D258A1F0C; Sat, 13 Aug 2022 22:42:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1660423362; s=20220809-q8oc; d=unstable.cc; i=a@unstable.cc; h=From:Cc:Date:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; l=1594; bh=u9s0BNYaUWvlgmsJLfIkIqiFiItTeiiWcmTSEreepAc=; b=rFLDPeE2XkzV+UVkozD1kYwn3NxcuuzBXVRV2QJvpf8c8pZ4SWMbBo3X13EOgfP9 /StjnYRIxCVepCQRtolVS1phVtrdOdnem0AQDfF6Xx4VqHgunTpLZIqScufCv+RbnCv DO637IOefYq+SBCEtrMbKIj5rlKgG3SXTKB3tL56zt6cYpzDCBkA8mUL3pI/2sufCgw 6AQ9pE+iEnCMO6Ghk+HYUfoGbGePWE7lOuY8AJYfWM7gyYQZU+SVJBWF/HzpC3GIoxY vXBfqQdHr5LULL6VGwzdvmFFw8A4ZFCmPt1RCJ57CyMFZtKDk795P0PzI5YY1fjiN0S QB5qshCESw== Received: by smtp.mailfence.com with ESMTPSA ; Sat, 13 Aug 2022 22:42:39 +0200 (CEST) From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Sat, 13 Aug 2022 22:42:24 +0200 Message-Id: <20220813204224.22576-7-a@unstable.cc> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220813204224.22576-1-a@unstable.cc> References: <20220813204224.22576-1-a@unstable.cc> MIME-Version: 1.0 X-Spam-Status: No, hits=-2.9 required=4.7 symbols=ALL_TRUSTED, BAYES_00, T_SCC_BODY_TEXT_LINE device=10.2.0.1 X-ContactOffice-Account: com:375058688 X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: renamed remote_addrX variables to vpn_addrX to make it clear that they refer to the address over the VPN/tunnel Signed-off-by: Antonio Quartulli --- src/openvpn/dco.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) Content analysis details: (-0.9 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.3.242.68 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-Headers-End: 1oMxy7-0004cf-7i Subject: [Openvpn-devel] [PATCH v101 7/7] dco: properly name variables 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: , Cc: Antonio Quartulli Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox renamed remote_addrX variables to vpn_addrX to make it clear that they refer to the address over the VPN/tunnel Signed-off-by: Antonio Quartulli Acked-by: Gert Doering --- src/openvpn/dco.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/openvpn/dco.c b/src/openvpn/dco.c index dcb570f9..0b56eec4 100644 --- a/src/openvpn/dco.c +++ b/src/openvpn/dco.c @@ -561,19 +561,20 @@ dco_multi_add_new_peer(struct multi_context *m, struct multi_instance *mi) remoteaddr = &c->c2.link_socket_info->lsa->actual.dest.addr.sa; } - struct in_addr remote_ip4 = { 0 }; - struct in6_addr *remote_addr6 = NULL; - struct in_addr *remote_addr4 = NULL; - /* In server mode we need to fetch the remote addresses from the push config */ + + struct in_addr vpn_ip4 = { 0 }; + struct in_addr *vpn_addr4 = NULL; if (c->c2.push_ifconfig_defined) { - remote_ip4.s_addr = htonl(c->c2.push_ifconfig_local); - remote_addr4 = &remote_ip4; + vpn_ip4.s_addr = htonl(c->c2.push_ifconfig_local); + vpn_addr4 = &vpn_ip4; } + + struct in6_addr *vpn_addr6 = NULL; if (c->c2.push_ifconfig_ipv6_defined) { - remote_addr6 = &c->c2.push_ifconfig_ipv6_local; + vpn_addr6 = &c->c2.push_ifconfig_ipv6_local; } if (dco_multi_get_localaddr(m, mi, &local)) @@ -582,7 +583,7 @@ dco_multi_add_new_peer(struct multi_context *m, struct multi_instance *mi) } int ret = dco_new_peer(&c->c1.tuntap->dco, peer_id, sd, localaddr, - remoteaddr, remote_addr4, remote_addr6); + remoteaddr, vpn_addr4, vpn_addr6); if (ret < 0) { return ret;