Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2392255lqo; Mon, 20 May 2024 04:41:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVNkZLsxGb+3Qx+358yTcjYhcdgsryJVfwZYf0AdOIjyf4FnDI+TE6q4nkd8m5cCSc4UP0uJlp5KwHpM4LIwcWd5xx/v3rUxgAoXH26lw== X-Google-Smtp-Source: AGHT+IHcAORKwHg6Eu7rx/fWGsdubN+nX3Dq4ZtFhTw0MNtJKJWI11nEG4GcXojPfby1BdJE0V0x X-Received: by 2002:a17:902:7888:b0:1e4:2b90:758e with SMTP id d9443c01a7336-1ef43e27badmr323987205ad.39.1716205283205; Mon, 20 May 2024 04:41:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716205283; cv=pass; d=google.com; s=arc-20160816; b=UdLlAcG3GVavtchsDUtFwA5C/TLMrV/bO56ghgTAzuFucDVBvLL7W6Zt3RYKnLSB8v roXSInxqFrq0RMMiMnohgAMwBkuk/zb9a/rvggPcWnRZYp8ZIP+bpJlqVry+7G59w2Z5 JZ34UZ0KQ8J1lcxW548mvbcHWcAwoA8YXwzVWXiv3Utuaq8ThUCnm9ikZdFPPm26S5nU /WXnZUgw6wqpUXtgH0ye1zufCL/HskmNcs1dN0Yh/4kavzkBVG8wGvIVeboUSyLBAJea fAw122VjmY8lgc4bxEwqtzB+I8hNJQmAUeyE1UqXRUk+LC1qY74CiNOy7uug9M0TMKvm 4/+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:to :from:subject:message-id:dkim-signature; bh=WwTSMnw7dKO/AgFPsWwYsEsVevXMKMS79IXwmEUQ7zI=; fh=9n4X/TEBW0XQEhJ3i1zvv/YvGrSMrftKxFV+bIJHsIE=; b=uqfLFFZQtbBgIhtTS8RopAYozBe6kjU4RiIeoPGyvADyoyynmuPRHbsw5ZRyYUIiPV IapJ3tf3iCRL6L56NZHsp2kGGAgvBV8Lx01PZZdlXoOWZlTquJTNtJAjuTd5eUIKsd2V qPRbqmgDW3j/VyBzB05zSKYs/0UtzL6UYI0Mg8NEZhBQjDxjI7cbe70lj49zwWUcKHIl lZROwv2606CW1bijgKvWhl8KAhMiMSmIRtmJlvuzppQgJ+DsKTiCybCT4JGSAwW5ZNcd mGy06OvY3RKEj29IJesGUDNm+PGkKm2ugLNBkXFOcLMILmP2T0E1XrJufg69dJBFHexb A02g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=K28xO3jp; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-7840-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7840-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0c153834si20076345ad.473.2024.05.20.04.41.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 04:41:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-7840-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=K28xO3jp; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-7840-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7840-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9CC61280ECA for ; Mon, 20 May 2024 11:41:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E92A25380C; Mon, 20 May 2024 11:41:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="K28xO3jp" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F1DAC51C28; Mon, 20 May 2024 11:41:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716205278; cv=none; b=HG79fCSj4tbqKXHbEiwvBFNozQKoziidzpiIZlYrr6pLJz3w4BDHMWU3zw2rA6a7ETZF0Jg9X/Kx7frea+9uIR+qzvTW6Kytx6y3ZrIgzFXqF+nJluvQfSirGG5vZqYBufG5NtKmqog2BbBEGKGrmmEp/AY3FtUTv2Kfgo+5rKg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716205278; c=relaxed/simple; bh=WwTSMnw7dKO/AgFPsWwYsEsVevXMKMS79IXwmEUQ7zI=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References: Content-Type:MIME-Version; b=gexYpG4i8AIYgHmEW2gJEnAXhcfgTtI57PAMjKSkqC3HDO8SSbGigzWGjvhBLqevl+LK1jEBn9qE4nENyQmcBeW51+uUHKUU2aB9vBjrlhGopiTWeTz/1U3DHPQ5HPy2BViCvFCN4OlnfNrUwpQkfvGW5oJ5iUG2K6mrA2BYGdY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=K28xO3jp; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:To:From:Subject:Message-ID:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=WwTSMnw7dKO/AgFPsWwYsEsVevXMKMS79IXwmEUQ7zI=; t=1716205276; x=1717414876; b=K28xO3jpLUTFZu/gkC6rtHlD/W1/8WrAhsnqfDQY5hYEPOI 2eDhxsxBeq7uppt5WmOAd/O0WSOhJK5vE8xDUlW5ERGBXfdFyN8MEtzllprDaOf6WdYET4EY4fC52 1U6nl8Ny2mmmDoz1STgiiVEw66M1BTN1oi7M3sXbNOr646I7Ue/edoeZBwairX3iSn8JhVll1rmSC lGSjSewFpLgYDqQWKk93m7WzOiVNAGt5I2KMuUS1pEhFaywv7vEHqCypUzR4wiKBT4x0a2jtT2EKx 6TADHdF78O0upbIfmH23jXiJ0AODt+UEewcZ5fmWdtz8uCWipcZ5jmBWTdL7A6kA==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1s91Nx-00000000BbZ-18IN; Mon, 20 May 2024 13:40:57 +0200 Message-ID: Subject: Re: [PATCH v1 net] cfg80211: pmsr: use correct nla_get_uX functions From: Johannes Berg To: Lin Ma , davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 20 May 2024 13:40:56 +0200 In-Reply-To: <20240520073311.44117-1-linma@zju.edu.cn> References: <20240520073311.44117-1-linma@zju.edu.cn> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.4 (3.50.4-1.fc39) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-malware-bazaar: not-scanned Couple of minor comments: The subject is missing wifi: prefix. On Mon, 2024-05-20 at 15:33 +0800, Lin Ma wrote: > The commit 9bb7e0f24e7e ("cfg80211: add peer measurement with FTM > initiator API") defines four attributes, which are >=20 > - `NL80211_PMSR_FTM_REQ_ATTR_NUM_BURSTS_EXP` with NLA_U8 type > - `NL80211_PMSR_FTM_REQ_ATTR_BURST_PERIOD` with NLA_U16 type > - `NL80211_PMSR_FTM_REQ_ATTR_BURST_DURATION` with NLA_U8 type > - `NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES` with NLA_U8 type >=20 > However, the consumers of these attributes in `pmsr_parse_ftm` blindly > all use `nla_get_u32`, which is incorrect. Hence, fix these with correct > `nla_get_u8` and `nla_get_u16`. Maybe mention a bit more clearly that the _policy_ actually defines them with those types, so the users are incorrect, vs. a possible scenario where the kernel's documentation is just incorrect and we have to keep the code as-is for userspace to continue to function. I believe the changes are correct since the policy wants the right types and then on little-endian platforms it'll all work ... johannes