From patchwork Fri Sep 27 09:30:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Lichtenheld X-Patchwork-Id: 3879 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:101b:b0:5b9:581e:f939 with SMTP id k27csp213126mae; Fri, 27 Sep 2024 02:31:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUFfdtGOQEvAm/THBdQo8YiDgubnhwL5CvDPmfN8KA6lZBUlo2QLBqydj8dyGt+lU6JCGPtNdSt/I8=@openvpn.net X-Google-Smtp-Source: AGHT+IGWa9xJw35K2x2YVe5wL6c8genzr3VBpUJ+ENDNukfSnrpPJ8zh3+IwprmiaiONBu3n+lL6 X-Received: by 2002:a05:6870:ed99:b0:287:a1e:a37c with SMTP id 586e51a60fabf-28710c25fe2mr1902931fac.40.1727429468279; Fri, 27 Sep 2024 02:31:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727429468; cv=none; d=google.com; s=arc-20240605; b=fxFAeJzHCH/CQbvNo7LvJPEc+L7PXtjiwiXSi7wue4cRaBaZbouoQAbioGNkhbjO1o EUUrV5fk9YQa3Xt9/NJRgYg9bOy8TpDaFqYdL0rr5DR1K1pKFh/u5epG8GRyo8fYIzyq Xxp5O5+ryixDouy3xN90S+pmoOqwC/nuaQ2K0knr5s4XNNdyzRr2rnRI3iaORABKkeQf pXMrLR/wBtUi5lguAI42B7285PUYIdBAEhb/Ja4IVzT8w43mEe/Wo57UWDfkcIw++UYf +q0c90vuPImhijdZxSCgCdiQQbdamVxDKg9SAMdZyj46jDWGjmY9thKs0n4Co2SAXcUh S9Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:cc:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=L/v1ghpeNwXBLKWdjcO+NyOhygs6/ZbRFM1eI+j2t+c=; fh=0RyyZcmSGuexStbtOiNZQw/y06CmO1Lz2QKttJyjUec=; b=McN9RLbUClpbtkvsbz5+EkssoCe3PGt07LJBswhUsRHIN2sko+EY+Jzt/Tk0nLv0L+ WsZVbW1G40fixTz6CZoWHmDVwwx7IoD6F4Eb1z8YU2Vks+VwflLp1xeZauzgiivlnBsf Tg2W1acIDfzMAziYg8BBP120qPx2MEgZsalf5ytNsLWG5SnPxj0zLn4k1nkSwbY/sRaf P5F2DCd0ATgTa1BLotjgk3V7vm4AP9/JP8QTzZzBWJFny085yv5bufv2R+6YtBZIR2si ctxEjH4L6lvBNRQoG5imGuxf0zoCKIz5sVBpe4QTFdPKzM/KsRCNzaU/PEhvn5oHjrrr fYSw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=RYYXn3xJ; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=DOfUJOM6; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=R902Lwnq; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 586e51a60fabf-2870f9a32c4si794882fac.185.2024.09.27.02.31.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Sep 2024 02:31:08 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=RYYXn3xJ; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=DOfUJOM6; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=R902Lwnq; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net 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 1su7JU-0004PZ-KK; Fri, 27 Sep 2024 09:31:01 +0000 Received: from [172.30.29.66] (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 1su7JR-0004PK-T5 for openvpn-devel@lists.sourceforge.net; Fri, 27 Sep 2024 09:30:59 +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=JrcwL+qemy82vBoD+eh2teHc85Jwq23IfN7pq5R2uNw=; b=RYYXn3xJ+3qJh8RqijMXb9G9jm J4DdJean9nLtPLc3uvnLwX+3xF8jI0IGogWH8ihQOOjpIrQbk72LYJXocP6yl89Jrsv4tK4S2kEqD OdyivDswe1sWyGLVQF1CcFcwwbsRKpV9wMdMG7mK5vXAtEr6gut6yBScd6RILvK/eo2I=; 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=JrcwL+qemy82vBoD+eh2teHc85Jwq23IfN7pq5R2uNw=; b=DOfUJOM62xcoIZNN6Kk0IbMusy O0s/50M6vCPUmwPj0ATf3U9TbfBjJOHOHWpAMxX/xmaSylIJ48HCNQKmllq5nH8UQ9RKyOq7NUKQw MNbc97JBpJqNtYtzpOzMpyhrZ7mrt402AbX+IEP12DtkHCaDV8EFfRJaJEPXhNUMBm1s=; Received: from mout-p-101.mailbox.org ([80.241.56.151]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1su7JP-0000Tl-Sg for openvpn-devel@lists.sourceforge.net; Fri, 27 Sep 2024 09:30:58 +0000 Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4XFQF32kY2z9stL; Fri, 27 Sep 2024 11:30:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lichtenheld.com; s=MBO0001; t=1727429447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JrcwL+qemy82vBoD+eh2teHc85Jwq23IfN7pq5R2uNw=; b=R902LwnqSRE7hDbRoEurk08V9lJrPfng2WC+go5bX7ARhMPcYNKpuqRYk3+zEc1XC/tHMx Q9IDiV/mj5QoMbeJqy4xH/fpU02XBPoDcLufDx8VURxRVO8n7T+lad0hPmnrVNg/l1SSgA SB1+FPOyuYuM2nX3z6fDJMIkCX6ooev5hXaqNQZ/wrtR1SkaWQ/b1PLpaTTjA8CO5aGJBK UaBrJU904mNzwtRCt+PDGo8hNTC7Xs2vD2k+JWgiIYkugRBDKhuHowUYhv9+0uFBlgYFLQ +IliFmfUsWDBaFY/GMH3+hC7fTLRjRyLzwdLqj5DJbB3+ha4AJgrffZQM2fmCQ== From: Frank Lichtenheld To: openvpn-devel@lists.sourceforge.net Date: Fri, 27 Sep 2024 11:30:45 +0200 Message-Id: <20240927093045.22753-1-frank@lichtenheld.com> In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 4.8 (++++) 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: From: Lev Stipakov Current naming (remote_in4/6) is confusing, since those are in fact VPN IPv4/v6 addresses and not related to remote at all. Change-Id: I101bbc9f682375ec733bca10b52da82f0abfec27 Signed-off-by: Lev Stipakov Acked-by: Antonio Quartulli --- Content analysis details: (4.8 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 5.0 RCVD_IN_UCE1 RBL: IP Listed in UCEPROTECT Level 1 [80.241.56.151 listed in dnsbl-1.uceprotect.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1su7JP-0000Tl-Sg Subject: [Openvpn-devel] [PATCH v4] dco: better naming for function parameters 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: Lev Stipakov , Antonio Quartulli Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1811341082117090196?= X-GMAIL-MSGID: =?utf-8?q?1811341082117090196?= From: Lev Stipakov Current naming (remote_in4/6) is confusing, since those are in fact VPN IPv4/v6 addresses and not related to remote at all. Change-Id: I101bbc9f682375ec733bca10b52da82f0abfec27 Signed-off-by: Lev Stipakov Acked-by: Antonio Quartulli --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/769 This mail reflects revision 4 of this Change. Acked-by according to Gerrit (reflected above): Antonio Quartulli diff --git a/src/openvpn/dco_freebsd.c b/src/openvpn/dco_freebsd.c index 9a90f5c..c92e42a 100644 --- a/src/openvpn/dco_freebsd.c +++ b/src/openvpn/dco_freebsd.c @@ -75,7 +75,7 @@ int dco_new_peer(dco_context_t *dco, unsigned int peerid, int sd, struct sockaddr *localaddr, struct sockaddr *remoteaddr, - struct in_addr *remote_in4, struct in6_addr *remote_in6) + struct in_addr *vpn_ipv4, struct in6_addr *vpn_ipv6) { struct ifdrv drv; nvlist_t *nvl; @@ -95,15 +95,15 @@ nvlist_add_nvlist(nvl, "remote", sockaddr_to_nvlist(remoteaddr)); } - if (remote_in4) + if (vpn_ipv4) { - nvlist_add_binary(nvl, "vpn_ipv4", &remote_in4->s_addr, - sizeof(remote_in4->s_addr)); + nvlist_add_binary(nvl, "vpn_ipv4", &vpn_ipv4->s_addr, + sizeof(vpn_ipv4->s_addr)); } - if (remote_in6) + if (vpn_ipv6) { - nvlist_add_binary(nvl, "vpn_ipv6", remote_in6, sizeof(*remote_in6)); + nvlist_add_binary(nvl, "vpn_ipv6", vpn_ipv6, sizeof(*vpn_ipv6)); } nvlist_add_number(nvl, "fd", sd); diff --git a/src/openvpn/dco_internal.h b/src/openvpn/dco_internal.h index 624c110..4bbcc82 100644 --- a/src/openvpn/dco_internal.h +++ b/src/openvpn/dco_internal.h @@ -62,7 +62,7 @@ int dco_new_peer(dco_context_t *dco, unsigned int peerid, int sd, struct sockaddr *localaddr, struct sockaddr *remoteaddr, - struct in_addr *remote_in4, struct in6_addr *remote_in6); + struct in_addr *vpn_ipv4, struct in6_addr *vpn_ipv6); int dco_del_peer(dco_context_t *dco, unsigned int peerid); diff --git a/src/openvpn/dco_linux.c b/src/openvpn/dco_linux.c index 277cd64..b038382 100644 --- a/src/openvpn/dco_linux.c +++ b/src/openvpn/dco_linux.c @@ -220,7 +220,7 @@ int dco_new_peer(dco_context_t *dco, unsigned int peerid, int sd, struct sockaddr *localaddr, struct sockaddr *remoteaddr, - struct in_addr *remote_in4, struct in6_addr *remote_in6) + struct in_addr *vpn_ipv4, struct in6_addr *vpn_ipv6) { struct gc_arena gc = gc_new(); const char *remotestr = "[undefined]"; @@ -263,14 +263,14 @@ } /* Set the primary VPN IP addresses of the peer */ - if (remote_in4) + if (vpn_ipv4) { - NLA_PUT_U32(nl_msg, OVPN_NEW_PEER_ATTR_IPV4, remote_in4->s_addr); + NLA_PUT_U32(nl_msg, OVPN_NEW_PEER_ATTR_IPV4, vpn_ipv4->s_addr); } - if (remote_in6) + if (vpn_ipv6) { NLA_PUT(nl_msg, OVPN_NEW_PEER_ATTR_IPV6, sizeof(struct in6_addr), - remote_in6); + vpn_ipv6); } nla_nest_end(nl_msg, attr); diff --git a/src/openvpn/dco_win.c b/src/openvpn/dco_win.c index 892c616..9224bca 100644 --- a/src/openvpn/dco_win.c +++ b/src/openvpn/dco_win.c @@ -247,7 +247,7 @@ int dco_new_peer(dco_context_t *dco, unsigned int peerid, int sd, struct sockaddr *localaddr, struct sockaddr *remoteaddr, - struct in_addr *remote_in4, struct in6_addr *remote_in6) + struct in_addr *vpn_ipv4, struct in6_addr *vpn_ipv6) { msg(D_DCO_DEBUG, "%s: peer-id %d, fd %d", __func__, peerid, sd); return 0;