linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Chen Shen <peterchenshen@gmail.com>
Cc: vyasevich@gmail.com, nhorman@tuxdriver.com, davem@davemloft.net,
	linux-sctp@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sctp: delete addr based on sin6_scope_id
Date: Sun, 25 Jul 2021 20:01:12 -0300	[thread overview]
Message-ID: <YP3tOORtoNHZXQdt@horizon.localdomain> (raw)
In-Reply-To: <20210725124339.72884-1-peterchenshen@gmail.com>

Hi,

The fix is right, but a couple of small changes:

On Sun, Jul 25, 2021 at 08:43:39PM +0800, Chen Shen wrote:
> sctp_inet6addr_event deletes 'addr' from 'local_addr_list' when setting
> netdev down, but it has possibility to delete the incorroct entry (match
                                                          ^ typo

> the first one with the same ipaddr, but the different 'ifindex'), if
> there are some netdevs with the same 'local-link' ipaddr added already.
> It should delete the entry depending on 'sin6_addr' and 'sin6_scope_id'
> both, otherwise, the endpoint will call 'sctp_sf_ootb' if it can't find
> the accroding association when receives 'heartbeat', and finally will
         ^^ typo

> reply 'abort' which causes the test case for NOKIA SYSCOM GW failed.
> 
...
> diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
> index 52c92b8d827f..66ebf1e3383d 100644
> --- a/net/sctp/ipv6.c
> +++ b/net/sctp/ipv6.c
> @@ -100,7 +100,9 @@ static int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev,
>  					&net->sctp.local_addr_list, list) {
>  			if (addr->a.sa.sa_family == AF_INET6 &&
>  					ipv6_addr_equal(&addr->a.v6.sin6_addr,
> -						&ifa->addr)) {
> +						&ifa->addr) &&
> +					addr->a.v6.sin6_scope_id ==
> +						ifa->idev->dev->ifindex) {

The indentation here is not right. It was wrong already, but lets
seize the moment and fix it. This is how it should look like:

 			if (addr->a.sa.sa_family == AF_INET6 &&
 			    ipv6_addr_equal(&addr->a.v6.sin6_addr,
					    &ifa->addr) &&
			    addr->a.v6.sin6_scope_id ==	ifa->idev->dev->ifindex) {

Thanks,
Marcelo

>  				sctp_addr_wq_mgmt(net, addr, SCTP_ADDR_DEL);
>  				found = 1;
>  				addr->valid = 0;
> -- 
> 2.19.0
> 

  reply	other threads:[~2021-07-25 23:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-25 12:43 [PATCH] sctp: delete addr based on sin6_scope_id Chen Shen
2021-07-25 23:01 ` Marcelo Ricardo Leitner [this message]
2021-07-26  5:47   ` [PATCH v2] " Chen Shen
2021-07-26 11:40     ` patchwork-bot+netdevbpf

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=YP3tOORtoNHZXQdt@horizon.localdomain \
    --to=marcelo.leitner@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sctp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=peterchenshen@gmail.com \
    --cc=vyasevich@gmail.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).