[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dff34170-fc5d-4344-b6a2-6af2b2903208@blackwall.org>
Date: Thu, 21 Dec 2023 10:52:41 +0200
From: Nikolay Aleksandrov <razor@...ckwall.org>
To: Lin Ma <linma@....edu.cn>, roopa@...dia.com, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
horatiu.vultur@...rochip.com, henrik.bjoernlund@...rochip.com,
bridge@...ts.linux.dev, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, horms@...nel.org
Subject: Re: [PATCH net-next v2] bridge: cfm: fix enum typo in
br_cc_ccm_tx_parse
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@....edu.cn>
> Reviewed-by: Simon Horman <horms@...nel.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@...ckwall.org>
Powered by blists - more mailing lists