mptcp.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Mat Martineau <mathew.j.martineau at linux.intel.com>
To: mptcp at lists.01.org
Subject: [MPTCP] Re: [PATCH mptcp-next v2] Squash to "selftests: mptcp: add addr argument for del_addr"
Date: Fri, 12 Mar 2021 11:01:40 -0800	[thread overview]
Message-ID: <86ce39db-8474-4dc1-5e12-42a9a4ecc12f@linux.intel.com> (raw)
In-Reply-To: 20210312141745.3326786-1-matthieu.baerts@tessares.net

[-- Attachment #1: Type: text/plain, Size: 2037 bytes --]

On Fri, 12 Mar 2021, Matthieu Baerts wrote:

> Avoid calling pm_nl_ctl with id > 255.
>
> Without this patch, we can see this when running the selftests:
>
>  selftests: net/mptcp: pm_netlink.sh
>  (...)
>  above hard addr limit                              [ OK ]
>  ./pm_nl_ctl add|get|set|del|flush|dump|accept
>   add [flags signal|subflow|backup] [id <nr>] [dev <name>] <ip>
>  del <id>
>   get <id>
>   set <ip> [flags backup|nobackup]
>   flush
>   dump
>  limits [<rcv addr max> <subflow max>]
>
>  id limit                                           [ OK ]
>  (...)
>
> That's because we were calling:
>
>  $ pm_nl_ctl del 256
>
> In the code, the parsed ID is written in a u_int8_t. Then the value
> "256" is stored as "0" which is now a special case and requires an IP.
>
> We could modify pm_nl_ctl and stop if the ID is negative or higher than
> 255 but not sure we need this for a tool only used in selftests.
>
> Signed-off-by: Matthieu Baerts <matthieu.baerts(a)tessares.net>
> ---
>
> Notes:
>    to be squashed in "selftests: mptcp: add addr argument for del_addr"
>
>    v2:
>      - only modify the for-loop higher limit. (Geliang)
>
> tools/testing/selftests/net/mptcp/pm_netlink.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/net/mptcp/pm_netlink.sh b/tools/testing/selftests/net/mptcp/pm_netlink.sh
> index a617e293734c..2ba91c63f24e 100755
> --- a/tools/testing/selftests/net/mptcp/pm_netlink.sh
> +++ b/tools/testing/selftests/net/mptcp/pm_netlink.sh
> @@ -100,7 +100,7 @@ done
> check "ip netns exec $ns1 ./pm_nl_ctl get 9" "id 9 flags signal 10.0.1.9" "hard addr limit"
> check "ip netns exec $ns1 ./pm_nl_ctl get 10" "" "above hard addr limit"
>
> -for i in `seq 9 256`; do
> +for i in `seq 9 255`; do
> 	ip netns exec $ns1 ./pm_nl_ctl del $i
> 	ip netns exec $ns1 ./pm_nl_ctl add 10.0.0.9 id $((i+1))
> done
> -- 
> 2.30.2

Thanks for the fix Matthieu, looks good to me.

--
Mat Martineau
Intel

             reply	other threads:[~2021-03-12 19:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-12 19:01 Mat Martineau [this message]
2021-03-13 10:16 [MPTCP] Re: [PATCH mptcp-next v2] Squash to "selftests: mptcp: add addr argument for del_addr" Matthieu Baerts

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=86ce39db-8474-4dc1-5e12-42a9a4ecc12f@linux.intel.com \
    --to=mptcp@lists.linux.dev \
    /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).