From patchwork Tue Oct 29 13:44:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "ordex (Code Review)" X-Patchwork-Id: 3917 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:c09d:b0:5b9:581e:f939 with SMTP id jr29csp259321mab; Tue, 29 Oct 2024 06:44:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVWM+q0o4p2Kxl3Uf6c06jEwt18o2fnWklG5XJKJUrzG97hxmTM82FZL0fk4kd6gXZ3M90qZqY62Hw=@openvpn.net X-Google-Smtp-Source: AGHT+IGvwJzfIFKo1HqpPOiO03emS7zw2WMeD7xImdVX0CtwA3TLOZ5j3VtCKad1uVOAkQho4qtU X-Received: by 2002:a05:6602:2b0a:b0:83a:acfa:b0ba with SMTP id ca18e2360f4ac-83b1c3b95famr1373060139f.1.1730209468899; Tue, 29 Oct 2024 06:44:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1730209468; cv=none; d=google.com; s=arc-20240605; b=SQ3FsEgpZb4Y8qJCrUtTZz361I7qOvbU7Mp7bDIb7Pe5bgg1bMrTaS/l50TuGa+R2A oYibBD5t+IDK82a6n/93Ob4cVHKXK8IhIw3Yyv5cHDHyMplbuIW181FWnA9l8HRw6UQ+ jiTDqpZrmBb++T8w1MClLximI5T50bYkpMeRxO04GU2koyUZw/Zji+bp7G7rUy3hhDfU saCtXuNNCC0Q4IgAEUbSBu7W1Bq8XFUy78u5Q8fZM5QOPQWDhpuXaA/YLPYkdw7g2Dlg /apCgrRup2g0zvsxB4o5NW8LvGF6Fjhc8vJ/QSvyhZ+GIA/xoK2RR94q5aaEK4FSsLxj Olzg== 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=3CQv5VqqrLCA5RSrnJMGRhFAW57xOxqDJqdVm3C6+5U=; fh=U7wEyxtwz2o5+UdevFSA47vNeG9knhWH0KV//QhD5a0=; b=c+cpj3uCr4oXPT9hYOiWUXzobi7ZPtce+n/6v0oYBzk6/Pi6dqDvu4eyvkdFHEZTYI 4zN9W5GOOmagG/g+3YyEmsl7xxORAhHzY4idCGfeLlmSa/TO+mMrucWcFcS6Ty8V9mKP 0Jpf6S93ErWET8NiMWn8HjHuu8n6WGHuY1/PZHw3ccdJnwJ7rYJ7n5jZZ7W3CVI9WAcx 43ABjN+Xq9B9l+aL9TKv9ujz+ZFf6nzCr7WgDUiKK0xEfzYbONCgDID2DcE/C8BrluSY ypQiFKoDoZxgL32DsvD1paNhfErQNFhNqJ2Km5bwP1AxtO7/WAhzmhj7u1DuYCKrotYF I8aw==; 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=QpwqhNTC; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=NQgktAkI; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b="YbLDyZ/3"; 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 8926c6da1cb9f-4dc72610cf0si5087333173.56.2024.10.29.06.44.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Oct 2024 06:44:28 -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=QpwqhNTC; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=NQgktAkI; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b="YbLDyZ/3"; 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-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5mWA-0001i4-Ho; Tue, 29 Oct 2024 13:44:17 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5mW9-0001hx-5T for openvpn-devel@lists.sourceforge.net; Tue, 29 Oct 2024 13:44:16 +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=W6W3XtspfvAbQHs9nO5lSoHL15Z5NbSnODzOVbZyxRU=; b=QpwqhNTCOBNYFZILrB7Amdn4PV GVxHu7Y+/rsNvNjXQnT1IOyUzkiuKZ5mnJQQYx2Q+LA4CYS5BnZXfXa9YBTNdcLiWttBuMCI7EcDt mqvzmF+uOspZCRGyO2f6kDlkKaGyCabbPlrdMSZVTpwM0vwf3Vwy0DGlp7I5hI4H91jE=; 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=W6W3XtspfvAbQHs9nO5lSoHL15Z5NbSnODzOVbZyxRU=; b=N QgktAkIzboAHiNk2suHpyJ3/NnY7h71IT8VczQMnnxdekWcMejDvF7q+NPx4ORfv2/yKeKVmXrtFX 34lsr2kuMeJ+2HLLCRQYJuf/hUuLvyW5hXXTZQRVkYU2HL/csKM+7OSLb+jtIq3478NDt3I2LA0PE eqIBnau1ztkcT/0s=; Received: from mail-wr1-f42.google.com ([209.85.221.42]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1t5mW7-000836-Kz for openvpn-devel@lists.sourceforge.net; Tue, 29 Oct 2024 13:44:16 +0000 Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-37d43a9bc03so3844145f8f.2 for ; Tue, 29 Oct 2024 06:44:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1730209449; x=1730814249; 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=W6W3XtspfvAbQHs9nO5lSoHL15Z5NbSnODzOVbZyxRU=; b=YbLDyZ/3Xt8SVS0uXUCJ/JUw930s7I70g8SjwYURBNXn9DSClxZMjT7F0wcOf4DQ3Y kXgEO11oyaSogYjiUvhe9mBkBryQjZyK9Xwn5sedo1QwSaBAnGYjkJoaCf53D/Pg4dvz FDvidXRcMgSZOE4Rz+eMUjmRJUUX/KVlWFswv7NmFwaIE7ScJ0w0Chh79QTpNpeDcb+m +CYZCYEfEvbkjqw/JmePCkNAjpmoPkslYCM9cFGn3ofCwmsWJ9e5YFXrpmDF9NLXdkXC sS3ztcyIQhx+svfBgzPaYUUxqd1Ed624jlsRtWZTfzz6rNFTRUx+pVL1jvRts5uIW3Bb Mksg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730209449; x=1730814249; 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=W6W3XtspfvAbQHs9nO5lSoHL15Z5NbSnODzOVbZyxRU=; b=OcR53B0mbtl1U3fmWOuuzTxdLGynKhum6ywB3Kw/sU+7L7AJVmZaSpkEI7DvMNkVw7 9gYvEQvajSSod0SCpZ4pMgkAOiazzOIJyJ34Q3x1E6R3THQ+nqLXeAYRWJclxhdnirpi 8G1ot5ltCtQ3+3ZEfnMHi/Xd2eQb5kLm3Wi2k+VigPpJbjwxXZZOM3kf24ZpOIj1GPds LCNA2e/ikDGk8oNCbbhFNqTiuzucxDN9W9dqBLVifYN3RE3GD8rrEtNw7tYUUIpGs9fC eNChOrTgQD9AWUYV1tLhJVvzDJR89JVJA0X3F8SbFowakDb3XAyGb4IguWxsJusIjrsb WNIA== X-Gm-Message-State: AOJu0YwyZpyIRqHiD3MZt09IQkONq2VBdEanAQM059/rk+wLMJKHcbi7 W1Z7C7bAsGUwQCqsfIsVCiX2bTeqivcxcsMEB6anOXzxvExJPH7JY7cti9eU7JRBYxdofNJpcyI h X-Received: by 2002:adf:e908:0:b0:37d:5046:571 with SMTP id ffacd0b85a97d-3806113dde0mr8606496f8f.22.1730209448927; Tue, 29 Oct 2024 06:44:08 -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 ffacd0b85a97d-38058b0ea58sm12599015f8f.15.2024.10.29.06.44.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2024 06:44:08 -0700 (PDT) From: "ordex (Code Review)" X-Google-Original-From: "ordex (Code Review)" X-Gerrit-PatchSet: 1 Date: Tue, 29 Oct 2024 13:44:07 +0000 To: plaisthos , flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: I9306a590a10a7d5cba32abe06d269494fec41ba6 X-Gerrit-Change-Number: 788 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: 73752d322e68d64a4702a7e1c975a8fe84a46b41 References: Message-ID: MIME-Version: 1.0 User-Agent: Gerrit/3.8.2 X-Spam-Score: -0.2 (/) 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: (-0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.221.42 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.221.42 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an 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 Message has at least one valid DKIM or DK signature -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.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1t5mW7-000836-Kz Subject: [Openvpn-devel] [S] Change in openvpn[master]: sitnl: replace NLMSG_TAIL macro with nlmsg_tail() function 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: a@unstable.cc, 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?1814256123679621420?= X-GMAIL-MSGID: =?utf-8?q?1814256123679621420?= 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/+/788?usp=email to review the following change. Change subject: sitnl: replace NLMSG_TAIL macro with nlmsg_tail() function ...................................................................... sitnl: replace NLMSG_TAIL macro with nlmsg_tail() function The NLMSG_TAIL macro never had any reason to exist, because libnl already provides a function doing exactly the same: nlmsg_tail(). Moreover, this macro was found to confuse gcc when compiling with -O3, which would result in subsequent warnings like: networking_sitnl.c:143:9: warning: writing 4 bytes into a region of size 0 [-Wstringop-overflow=] 143 | memcpy(RTA_DATA(rta), data, alen); | ^ networking_sitnl.c:101:21: note: at offset [72, 88] into destination object ā€˜nā€™ of size 16 101 | struct nlmsghdr n; | ^ (Above warnings are critical on Fedora 40 as they are turned into errors) Delete the macro, replace it with nlmsg_tail() and get rid of the warnings. Change-Id: I9306a590a10a7d5cba32abe06d269494fec41ba6 Signed-off-by: Antonio Quartulli --- M src/openvpn/networking_sitnl.c 1 file changed, 4 insertions(+), 6 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/88/788/1 diff --git a/src/openvpn/networking_sitnl.c b/src/openvpn/networking_sitnl.c index f53f5ee..8eeab72 100644 --- a/src/openvpn/networking_sitnl.c +++ b/src/openvpn/networking_sitnl.c @@ -40,6 +40,7 @@ #include #include #include +#include #define SNDBUF_SIZE (1024 * 2) #define RCVBUF_SIZE (1024 * 4) @@ -52,19 +53,16 @@ } \ } -#define NLMSG_TAIL(nmsg) \ - ((struct rtattr *)(((uint8_t *)(nmsg)) + NLMSG_ALIGN((nmsg)->nlmsg_len))) - #define SITNL_NEST(_msg, _max_size, _attr) \ ({ \ - struct rtattr *_nest = NLMSG_TAIL(_msg); \ + struct rtattr *_nest = nlmsg_tail(_msg); \ SITNL_ADDATTR(_msg, _max_size, _attr, NULL, 0); \ _nest; \ }) #define SITNL_NEST_END(_msg, _nest) \ { \ - _nest->rta_len = (void *)NLMSG_TAIL(_msg) - (void *)_nest; \ + _nest->rta_len = (void *)nlmsg_tail(_msg) - (void *)_nest; \ } /** @@ -130,7 +128,7 @@ return -EMSGSIZE; } - rta = NLMSG_TAIL(n); + rta = nlmsg_tail(n); rta->rta_type = type; rta->rta_len = len;