Message ID | 20231220163451.2720130-1-linma@zju.edu.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-7305-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2765098dyi; Wed, 20 Dec 2023 08:36:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IGuGXi5bacSpGHc6zQ6kUfKJOssYRXa6BkRPNFO3Gen7TzjvyjtpLqAN2O5LVT04oAOwkC6 X-Received: by 2002:a05:622a:44d:b0:427:80b7:c824 with SMTP id o13-20020a05622a044d00b0042780b7c824mr3024752qtx.45.1703090161245; Wed, 20 Dec 2023 08:36:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703090161; cv=none; d=google.com; s=arc-20160816; b=tPBvPYhxKhiFtFB9DPjtP4Z9J8wP1Qmn9qW7KBxLPKYelyyHMI8otPWkiWGty7z1IM eBXFi1mkwMU+vliL991NgF6Un+oYHYeQY6EY2MOg1gDtTyCbDfwQozGBiUwzME9FPxor sAV4/rZEBHII5Kn0OTJOnytGudUzjaCQqclCz3mNg3cRMt+zSSbEtDvJ2RnhuHBAgeZk /Ipjz6vrMdCIWBsjwHJSPsQ2yw0DFg1ZIuCkQZ87lJb6Ls++DEV01nztbgMeepGh8C/5 GqBNY8vpT9WsVKVytm3bk6kMEUZyl1Rw/LFDRaNjrBuiFs8JfPqIFRYd18BHUM2z+Czr 7gxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from; bh=2SW0sXaLUNppKNup3yzbgBheD9FDRHZl/iboe8dWI1M=; fh=T3GAQb86RsvDlGruhQZGex5U2gcFQodftEqGqd7Y8bI=; b=FKhzp3EIFKIRncEpZkqdPY08qecpFcL0p46Xwb3lWJRwmdHR1xsO7ENYbGBGhlxBJ5 vo5lXfySF2w8abFiI53mHOHZ6y3m1pD/HdbrElTaIil76WnVHHhWXIaKqj7znn/wSR4I MWwz0C9+o4eCmmxImgQ52XhcediOjiKKYXgvOvmeiqW7fc7KFt8ptta0Dl789D0YNfuk H00WFI+pylJfOVT1jyEcVUATcPHIdVinRSKGxykbakDttaL/YTn+LlQHVMnhVv1/haTQ zkPW4yl+xsEdf0QCZw83ePD8bFAEuFnrI8rLr2WoqJLEcCNWsLM+Cx4KVUUFA3goOY1K avUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-7305-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7305-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id z8-20020ac87f88000000b0042544be7b01si39010qtj.537.2023.12.20.08.36.01 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 08:36:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7305-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-7305-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7305-ouuuleilei=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 0D7661C20975 for <ouuuleilei@gmail.com>; Wed, 20 Dec 2023 16:36:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9AB8047773; Wed, 20 Dec 2023 16:35:31 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from azure-sdnproxy.icoremail.net (azure-sdnproxy.icoremail.net [52.237.72.81]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CCAA046548; Wed, 20 Dec 2023 16:35:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=zju.edu.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zju.edu.cn Received: from localhost.localdomain (unknown [125.119.253.244]) by mail-app2 (Coremail) with SMTP id by_KCgCHjk6zF4Nl4YbNAA--.63814S4; Thu, 21 Dec 2023 00:34:59 +0800 (CST) From: Lin Ma <linma@zju.edu.cn> To: roopa@nvidia.com, razor@blackwall.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, horatiu.vultur@microchip.com, henrik.bjoernlund@microchip.com, bridge@lists.linux.dev, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, horms@kernel.org Cc: Lin Ma <linma@zju.edu.cn> Subject: [PATCH net-next v2] bridge: cfm: fix enum typo in br_cc_ccm_tx_parse Date: Thu, 21 Dec 2023 00:34:51 +0800 Message-Id: <20231220163451.2720130-1-linma@zju.edu.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: by_KCgCHjk6zF4Nl4YbNAA--.63814S4 X-Coremail-Antispam: 1UD129KBjvJXoW7tF1xGrW8urWrWw4kKr4UArb_yoW8Gw13pF 4rKa95CFs0yryYv34j9F4vvr9FkF4DWay3u3yDur1Ivrn0gF13CrZ8Gry3ur1xAF4DKw13 AF15WrWaqa98AFUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9j14x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4U JVWxJr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AKxV W8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xf McIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7 v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF 7I0E8cxan2IY04v7MxkIecxEwVAFwVWUMxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4 AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE 17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMI IF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4l IxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvf C2KfnxnUUI43ZEXa7VUU6nQUUUUUU== X-CM-SenderInfo: qtrwiiyqvtljo62m3hxhgxhubq/ Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785819469101572111 X-GMAIL-MSGID: 1785819469101572111 |
Series |
[net-next,v2] bridge: cfm: fix enum typo in br_cc_ccm_tx_parse
|
|
Commit Message
Lin Ma
Dec. 20, 2023, 4:34 p.m. UTC
It appears that there is a typo in the code where the nlattr array is being parsed with policy br_cfm_cc_ccm_tx_policy, but the instance is being accessed via IFLA_BRIDGE_CFM_CC_RDI_INSTANCE, which is associated with the policy br_cfm_cc_rdi_policy. This problem was introduced by commit 2be665c3940d ("bridge: cfm: Netlink SET configuration Interface."). Though it seems like a harmless typo since these two enum owns the exact same value (1 here), it is quite misleading hence fix it by using the correct enum IFLA_BRIDGE_CFM_CC_CCM_TX_INSTANCE here. Signed-off-by: Lin Ma <linma@zju.edu.cn> Reviewed-by: Simon Horman <horms@kernel.org> --- V1 -> V2: remove Fixes tag as this patch resolves nothing but a typo. net/bridge/br_cfm_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 20/12/2023 18:34, Lin Ma wrote: > It appears that there is a typo in the code where the nlattr array is > being parsed with policy br_cfm_cc_ccm_tx_policy, but the instance is > being accessed via IFLA_BRIDGE_CFM_CC_RDI_INSTANCE, which is associated > with the policy br_cfm_cc_rdi_policy. > > This problem was introduced by commit 2be665c3940d ("bridge: cfm: Netlink > SET configuration Interface."). > > Though it seems like a harmless typo since these two enum owns the exact > same value (1 here), it is quite misleading hence fix it by using the > correct enum IFLA_BRIDGE_CFM_CC_CCM_TX_INSTANCE here. > > Signed-off-by: Lin Ma <linma@zju.edu.cn> > Reviewed-by: Simon Horman <horms@kernel.org> > --- > V1 -> V2: remove Fixes tag as this patch resolves nothing but a typo. > > net/bridge/br_cfm_netlink.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/bridge/br_cfm_netlink.c b/net/bridge/br_cfm_netlink.c > index 5c4c369f8536..2faab44652e7 100644 > --- a/net/bridge/br_cfm_netlink.c > +++ b/net/bridge/br_cfm_netlink.c > @@ -362,7 +362,7 @@ static int br_cc_ccm_tx_parse(struct net_bridge *br, struct nlattr *attr, > > memset(&tx_info, 0, sizeof(tx_info)); > > - instance = nla_get_u32(tb[IFLA_BRIDGE_CFM_CC_RDI_INSTANCE]); > + instance = nla_get_u32(tb[IFLA_BRIDGE_CFM_CC_CCM_TX_INSTANCE]); > nla_memcpy(&tx_info.dmac.addr, > tb[IFLA_BRIDGE_CFM_CC_CCM_TX_DMAC], > sizeof(tx_info.dmac.addr)); Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Hello: This patch was applied to netdev/net-next.git (main) by David S. Miller <davem@davemloft.net>: On Thu, 21 Dec 2023 00:34:51 +0800 you wrote: > It appears that there is a typo in the code where the nlattr array is > being parsed with policy br_cfm_cc_ccm_tx_policy, but the instance is > being accessed via IFLA_BRIDGE_CFM_CC_RDI_INSTANCE, which is associated > with the policy br_cfm_cc_rdi_policy. > > This problem was introduced by commit 2be665c3940d ("bridge: cfm: Netlink > SET configuration Interface."). > > [...] Here is the summary with links: - [net-next,v2] bridge: cfm: fix enum typo in br_cc_ccm_tx_parse https://git.kernel.org/netdev/net-next/c/c2b2ee36250d You are awesome, thank you!
diff --git a/net/bridge/br_cfm_netlink.c b/net/bridge/br_cfm_netlink.c index 5c4c369f8536..2faab44652e7 100644 --- a/net/bridge/br_cfm_netlink.c +++ b/net/bridge/br_cfm_netlink.c @@ -362,7 +362,7 @@ static int br_cc_ccm_tx_parse(struct net_bridge *br, struct nlattr *attr, memset(&tx_info, 0, sizeof(tx_info)); - instance = nla_get_u32(tb[IFLA_BRIDGE_CFM_CC_RDI_INSTANCE]); + instance = nla_get_u32(tb[IFLA_BRIDGE_CFM_CC_CCM_TX_INSTANCE]); nla_memcpy(&tx_info.dmac.addr, tb[IFLA_BRIDGE_CFM_CC_CCM_TX_DMAC], sizeof(tx_info.dmac.addr));