From patchwork Fri Aug 12 03:06:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 2662 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 SGKBH+FQ9mI3NQAAIUCqbw (envelope-from ) for ; Fri, 12 Aug 2022 09:08:49 -0400 Received: from proxy3.mail.ord1d.rsapps.net ([172.30.191.6]) by director7.mail.ord1d.rsapps.net with LMTP id SNptH+FQ9mKORAAAovjBpQ (envelope-from ) for ; Fri, 12 Aug 2022 09:08:49 -0400 Received: from smtp19.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy3.mail.ord1d.rsapps.net with LMTPS id cBgrH+FQ9mI5GQAA7WKfLA (envelope-from ) for ; Fri, 12 Aug 2022 09:08:49 -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: smtp19.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=fail (p=none; dis=none) header.from=unstable.cc X-Suspicious-Flag: YES X-Classification-ID: e7163f3e-1a3f-11ed-b745-525400d67fa8-1-1 Received: from [216.105.38.7] ([216.105.38.7:49856] helo=lists.sourceforge.net) by smtp19.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 24/5A-19238-0E056F26; Fri, 12 Aug 2022 09:08:48 -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.95) (envelope-from ) id 1oMUNV-0000tW-02; Fri, 12 Aug 2022 13:07:05 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oMUN5-0000sY-7G for openvpn-devel@lists.sourceforge.net; Fri, 12 Aug 2022 13:06:54 +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=GdObcquAz6cyvzqSlDg6Kx58OinQEEGq0GuRqXbbNCQ=; b=UfV2n2tZ07ND+VuK23AuyrSjaC sipbVXn4D1K2tgTHNOBUckdrSoDf9jRntfJlZoMX/kKeRHSVndxLVwhY0e4v80Xnx4owRPfSe6/yR FI0FH3XC4yP5QrzUyIRNkvPNZF4lfYK8xzRVKdIwp9JMvmetNoSg2+pg5FzAAhWQ6a8E=; 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=GdObcquAz6cyvzqSlDg6Kx58OinQEEGq0GuRqXbbNCQ=; b=UeXjRkfC2SvC3WZPiVFCMKLzAx fYyUL98Ou1iSimXezaLvFEj8n72xv+4QzDKcLosTkdBKlfSmLX79vWVZvdfhwhtz/QnTkwnuXlJ3Q TNmgrQp/JwDrJfBHw3LD4w7/JoIj06kwc3hjmN34muEERQnLzKbAcevsyRWGVnTWy5M8=; Received: from s2.neomailbox.net ([5.148.176.60]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.94.2) id 1oMUN1-00DFYu-Ci for openvpn-devel@lists.sourceforge.net; Fri, 12 Aug 2022 13:06:38 +0000 From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Fri, 12 Aug 2022 15:06:56 +0200 Message-Id: <20220812130657.29899-10-a@unstable.cc> In-Reply-To: <20220812130657.29899-1-a@unstable.cc> References: <20220812130657.29899-1-a@unstable.cc> MIME-Version: 1.0 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: (1.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) X-Headers-End: 1oMUN1-00DFYu-Ci Subject: [Openvpn-devel] [PATCH v100 09/10] 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 --- 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 d330d917..2b7b742a 100644 --- a/src/openvpn/dco.c +++ b/src/openvpn/dco.c @@ -553,19 +553,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)) @@ -574,7 +575,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;