netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Lin Ma <linma@zju.edu.cn>
Cc: 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
Subject: Re: [PATCH v1] bridge: cfm: fix enum typo in br_cc_ccm_tx_parse
Date: Wed, 20 Dec 2023 17:17:42 +0100	[thread overview]
Message-ID: <20231220161742.GM882741@kernel.org> (raw)
In-Reply-To: <20231220075914.2426376-1-linma@zju.edu.cn>

On Wed, Dec 20, 2023 at 03:59:14PM +0800, 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.
> 
> 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.
> 
> Fixes: 2be665c3940d ("bridge: cfm: Netlink SET configuration Interface.")
> Signed-off-by: Lin Ma <linma@zju.edu.cn>

Thanks Lin Ma,

I agree with your analysis, that the problem was introduced in the
cited commit, and that it is resolved by your patch.

However, as there is no user-visible bug I don't believe this reaches
the bar for a 'fix' for Networking code. Accordingly, I think that
the Fixes tag should be dropped. And, instead cited commit can be mentioned
using something like "This problem was introduced by commit ...".

Also, as I don't think it is a fix I think it should be targeted at the
net-next tree:

	Subject: [PATCH net-next vX] ...

The above nits notwithstanding,

Reviewed-by: Simon Horman <horms@kernel.org>

> ---
>  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));
> -- 
> 2.17.1
> 
> 

  reply	other threads:[~2023-12-20 16:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-20  7:59 [PATCH v1] bridge: cfm: fix enum typo in br_cc_ccm_tx_parse Lin Ma
2023-12-20 16:17 ` Simon Horman [this message]
2023-12-20 16:29   ` Lin Ma
2023-12-20 16:53     ` Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231220161742.GM882741@kernel.org \
    --to=horms@kernel.org \
    --cc=bridge@lists.linux.dev \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=henrik.bjoernlund@microchip.com \
    --cc=horatiu.vultur@microchip.com \
    --cc=kuba@kernel.org \
    --cc=linma@zju.edu.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    --cc=roopa@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).