From patchwork Wed Sep 25 07:23:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "flichtenheld (Code Review)" X-Patchwork-Id: 3872 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:6c93:b0:5b9:581e:f939 with SMTP id p19csp166311may; Wed, 25 Sep 2024 00:23:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVk56auNQcJN592Q3I2ijjayq+Mbn6L1DGQJH1RNrXlxdvaj5/u7HpXy5wRVdeA22cp2IRMOe+qB+k=@openvpn.net X-Google-Smtp-Source: AGHT+IF78gfgPY7yWGa2MxjZKX2Q9SFOIioXqqdlMPvyZpVd64yBge3laPEvO+lmMHD+dqTSOEpX X-Received: by 2002:a05:6602:150f:b0:82a:418d:b03f with SMTP id ca18e2360f4ac-83247d2ba72mr224487939f.8.1727249006035; Wed, 25 Sep 2024 00:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727249006; cv=none; d=google.com; s=arc-20240605; b=efHj/8Hzl48Gvg9Ru0j8ZqBttjosnRU1b3YHMsAGhV6y1AfPiHNaTN3nUly/pvxtpv DEy3wOW6vd6/3/MryJQEx0/1C+DZObqWKdUlKoDXT68z2Sb5K2DBa6e5GiMluOB0xq3C O2VAGcvrooduiWp5SYvz7wXznJRSzyoEbbhXmswxsLLlQPHxVCJ5ZjsmMPiA3JFSBQ3Y SjY3jXomk6X/HHk2pHtp/QZSUwgIblhuGbFRURy6wbIqPGXFfQe4CPwzFdMQD+QEbciY wf03RC3KjLv7v0mOVnuxDxeuqmn1NTxfL9UVftt3Moh7FMTUsZ4WdpxpRyiC+GLempGO B08g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:user-agent :mime-version:message-id:references:auto-submitted:to:date:from :dkim-signature:dkim-signature:dkim-signature; bh=Vu1B1nW9drJRaGet4bxfTwz2cheXb2a1iJekfXYyvPc=; fh=U7wEyxtwz2o5+UdevFSA47vNeG9knhWH0KV//QhD5a0=; b=K6V81l3fUyqChV3j6Ono7wCGyw/EKWWH+szsGyIbxaPyp+CedsZb61TBGea9ZA3xwl oTyWWTjtgsRL77+jSNSJoHrPuy5egmdp4o9RAoBUDUA2MrSr3X8YhLBfLhcs265c+AKl 7XUAoGuEhBwjPTw7SvJrJZiZ0OWimAm/QGLDqmgtQJhFPmVBsGp488ea6ia/q1+afRRZ 14PmqFmP08gNig6j3dUkv1tHbLQZgwqI0aiJDuC6pG6jOHyVztKTLstnFkh+U9epluCb ykZyQFJl2soC8N6aBla56y95u0fOCMqzQFUVnypUZu53lsrYWCUYHsNz2JuK+dKUCJD3 R1pQ==; 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=c+Y1QmZy; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Q5dtgG4q; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b="Y2Gux/cF"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvpn.net; dara=fail header.i=@openvpn.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id ca18e2360f4ac-8323f604d4csi140307539f.75.2024.09.25.00.23.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Sep 2024 00:23:26 -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=c+Y1QmZy; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Q5dtgG4q; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b="Y2Gux/cF"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvpn.net; dara=fail header.i=@openvpn.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 1stMMl-0002LT-CN; Wed, 25 Sep 2024 07:23:16 +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 1stMMk-0002LN-Od for openvpn-devel@lists.sourceforge.net; Wed, 25 Sep 2024 07:23:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :Message-ID:Reply-To:References:Subject:List-Unsubscribe:List-Id:Cc:To:Date: From:Sender:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help: List-Subscribe:List-Post:List-Owner:List-Archive; bh=aU+b5lV7qugqi+17eG5t1G1LOthc7vIiEYZm6kjmyuo=; b=c+Y1QmZy/HG+G/slN3gnsrsy2O H5bL19dRSLvOW2SgVzcsMXwvpiAdskWlOQnxXqQXBBoziRjX8LUw4nVpcOhD6KiV2eODn489pfcGd ERIBRQfHavl6+Of3g7De0nP2zTStzddx0XG5U0fUNtDEOLgCWMXOTK6GoiskjyRDqPNM=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Reply-To: References:Subject:List-Unsubscribe:List-Id:Cc:To:Date:From:Sender:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help:List-Subscribe:List-Post: List-Owner:List-Archive; bh=aU+b5lV7qugqi+17eG5t1G1LOthc7vIiEYZm6kjmyuo=; b=Q 5dtgG4qgxvEhkLy6G1zG4IcueOOfwRxifehnht6TQemezeVPK0dKqDq9Xja4PApCVB7mqP+I53PLm ddHFeiJz2x4Gke1/ZRHhC5SDrkueJkipD3WwvHBdjFg2Qogp9ZcUMcnxY+N4KCky8QdToxCvWO4jO ANrB0Yx9M55VuhRg=; Received: from mail-wm1-f41.google.com ([209.85.128.41]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1stMMk-0007pe-6a for openvpn-devel@lists.sourceforge.net; Wed, 25 Sep 2024 07:23:15 +0000 Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-42bb7298bdeso81583365e9.1 for ; Wed, 25 Sep 2024 00:23:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1727248988; x=1727853788; darn=lists.sourceforge.net; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from:from:to:cc :subject:date:message-id:reply-to; bh=aU+b5lV7qugqi+17eG5t1G1LOthc7vIiEYZm6kjmyuo=; b=Y2Gux/cFWGo/K4S3D6z5xmRCp1fsSziM4qEL7zBihm9QEw3t9Fy6WAjDxLk5AzdoGr v8m76PqKlIBRvhnhcc3rJofdmZ0788CLra0048UGMOFxCYQpijMGhI2T/UmUKe3GqsNR Mb16o5uLGESj6rJ35i01ez0WGwWMMr5pOhygNbepc3zj1Stexr8VFRbhov7Ne0irwiW/ wtLqU3SpdMhq+B/IuDqnvlyQvrb1zLF7TfqxOn93/OhjUiHWWJpM+b2UTPR4HjSiHJNY cKZ/ob36YBZrAR4TeThgluLMVy/kBdu48c3+uOIA4Nc+tDNHYD/zTfiuH7BL5tGTctkx xRaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727248988; x=1727853788; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aU+b5lV7qugqi+17eG5t1G1LOthc7vIiEYZm6kjmyuo=; b=UxCBX4Wszv59BmlY6vXKRb9mzkqb20h5QC3d9BotKrCAhAUO47zd2cp5b36+CpQd/l uHZIAsk1XTRl6Q7PUp2cNqQXadOpbf7bfc+dneWPZT7Sn/g1ol15S99QoZ4G13NGlT8n ePYmzSE1GYl4UnMh+c/+60P9/2bw6baCCgR8Hm4ws9L3gy7U/qR8vPpvjDWOogj9P/0d hp+JnqraxTR09/trR28Le3mfRUEv9bfTgx+/lhvd7eXcvHq9YZFPKfEPkEaGox+QemPo lp8Jc0WaOewqo1NCgxxlEnzi73147VYV8zbi8IdRyBHhUi7uQYROoPDgfFVRe9cFHZ9c 9oig== X-Gm-Message-State: AOJu0Yzwvu506mB9ckRcae8/24PzHYa2lgiyjliUZMrFd9N6Z7sEZx1I cuxDL6bddXPUIENcWmCB6Xp1AwydZAvtjnoUK0oGKm7aETURMIE1D63hcoHwOSxwS5QCNHZWiXx e X-Received: by 2002:a05:600c:1e1d:b0:42c:de34:34d8 with SMTP id 5b1f17b1804b1-42e96141602mr13041035e9.27.1727248987489; Wed, 25 Sep 2024 00:23:07 -0700 (PDT) Received: from gerrit.openvpn.in (ec2-18-159-0-78.eu-central-1.compute.amazonaws.com. [18.159.0.78]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e969ddcc4sm9471785e9.10.2024.09.25.00.23.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2024 00:23:06 -0700 (PDT) From: "stipa (Code Review)" X-Google-Original-From: "stipa (Code Review)" X-Gerrit-PatchSet: 1 Date: Wed, 25 Sep 2024 07:23:05 +0000 To: plaisthos , flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: I101bbc9f682375ec733bca10b52da82f0abfec27 X-Gerrit-Change-Number: 769 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: ade326b1894365acc33055b601d4520e31f8654c References: Message-ID: <60df37c7b1b9ea4cf1203719f5f664f9924a5b3f-HTML@gerrit.openvpn.net> MIME-Version: 1.0 User-Agent: Gerrit/3.8.2 X-Spam-Score: -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: Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit Content analysis details: (-1.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.8 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.41 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP 0.0 HTML_MESSAGE BODY: HTML included in message -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 0.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1stMMk-0007pe-6a Subject: [Openvpn-devel] [S] Change in openvpn[master]: dco: better naming for funtion 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: , Reply-To: lstipakov@gmail.com, arne-openvpn@rfc2549.org, openvpn-devel@lists.sourceforge.net, frank@lichtenheld.com Cc: openvpn-devel Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1811151853274811105?= X-GMAIL-MSGID: =?utf-8?q?1811151853274811105?= X-getmail-filter-classifier: gerrit message type newchange Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/769?usp=email to review the following change. Change subject: dco: better naming for funtion parameters ...................................................................... dco: better naming for funtion parameters Current naming (remote_in4/6) is confusing, since those are in fact VPN IPv4/v4 addresses and not related to remote at all. Change-Id: I101bbc9f682375ec733bca10b52da82f0abfec27 Signed-off-by: Lev Stipakov --- M src/openvpn/dco_freebsd.c M src/openvpn/dco_internal.h M src/openvpn/dco_linux.c M src/openvpn/dco_win.c 4 files changed, 13 insertions(+), 13 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/69/769/1 diff --git a/src/openvpn/dco_freebsd.c b/src/openvpn/dco_freebsd.c index 9a90f5c..2f565a0 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_in4, struct in6_addr *vpn_in6) { struct ifdrv drv; nvlist_t *nvl; @@ -95,15 +95,15 @@ nvlist_add_nvlist(nvl, "remote", sockaddr_to_nvlist(remoteaddr)); } - if (remote_in4) + if (vpn_in4) { - nvlist_add_binary(nvl, "vpn_ipv4", &remote_in4->s_addr, - sizeof(remote_in4->s_addr)); + nvlist_add_binary(nvl, "vpn_ipv4", &vpn_in4->s_addr, + sizeof(vpn_in4->s_addr)); } - if (remote_in6) + if (vpn_in6) { - nvlist_add_binary(nvl, "vpn_ipv6", remote_in6, sizeof(*remote_in6)); + nvlist_add_binary(nvl, "vpn_ipv6", vpn_in6, sizeof(*vpn_in6)); } nvlist_add_number(nvl, "fd", sd); diff --git a/src/openvpn/dco_internal.h b/src/openvpn/dco_internal.h index 624c110..240a6a4 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_in4, struct in6_addr *vpn_in6); 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..b110896 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_in4, struct in6_addr *vpn_in6) { 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_in4) { - 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_in4->s_addr); } - if (remote_in6) + if (vpn_in6) { NLA_PUT(nl_msg, OVPN_NEW_PEER_ATTR_IPV6, sizeof(struct in6_addr), - remote_in6); + vpn_in6); } nla_nest_end(nl_msg, attr); diff --git a/src/openvpn/dco_win.c b/src/openvpn/dco_win.c index 892c616..6a3476b 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_in4, struct in6_addr *vpn_in6) { msg(D_DCO_DEBUG, "%s: peer-id %d, fd %d", __func__, peerid, sd); return 0;