All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jianguo Wu <wujianguo106@163.com>
To: Matthieu Baerts <matthieu.baerts@tessares.net>,
	Geliang Tang <geliangtang@gmail.com>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH] mptcp: create listening socket only if signal flag is set on
Date: Fri, 23 Apr 2021 16:38:51 +0800	[thread overview]
Message-ID: <4b4f4935-138d-a6fc-dfdc-3ef059a33c3e@163.com> (raw)
In-Reply-To: <3c3cf25d-aa4c-d522-102b-ebdd3b767cc0@tessares.net>



On 2021/4/23 16:21, Matthieu Baerts wrote:
> Hi Jianguo, Geliang,
> 
> Thank you for the patches and reviews!
> 
> On 23/04/2021 09:41, Jianguo Wu wrote:
>>
>>
>> On 2021/4/23 15:27, Geliang Tang wrote:
>>> Geliang Tang <geliangtang@gmail.com> 于2021年4月23日周五 下午3:17写道:
>>>>
>>>> Hi Jianguo,
>>>>
>>>> Jianguo Wu <wujianguo106@163.com> 于2021年4月23日周五 下午2:39写道:
>>>>>
>>>>>
>>>>>
>>>>> On 2021/4/23 12:33, Geliang Tang wrote:
>>>>>> Hi Jianguo,
>>>>>>
>>>>>> Thanks for your patch.
>>>>>>
>>>>>> Jianguo Wu <wujianguo106@163.com> 于2021年4月22日周四 下午6:30写道:
>>>>>>>
>>>>>>> From: Jianguo Wu <wujianguo@chinatelecom.cn>
>>>>>>>
>>>>>>> PM announces address to remote host when signal flag is set,
>>>>>>> so create listening socket only if signal flag is set.
>>>>>>
>>>>>> This check has done in the user-space, here are these lines in pm_nl_ctl.c:
>>>>>>
>>>>>> 274                 } else if (!strcmp(argv[arg], "port")) {
>>>>>> 275                         u_int16_t port;
>>>>>> 276
>>>>>> 277                         if (++arg >= argc)
>>>>>> 278                                 error(1, 0, " missing port value");
>>>>>> 279                         if (!(flags & MPTCP_PM_ADDR_FLAG_SIGNAL))
>>>>>> 280                                 error(1, 0, " flags must be signal
>>>>>> when using port");
>>>>>>
>>>>>
>>>>> Hi Geliang, Thanks for point out this, I was use 'ip mptcp' to add address, It doesn't seem to have done that check.
>>>>> Is it worth to do check in kernel to make sure there is a signal flag before create listening socket?
>>>>
>>>> I think it's better to check this in the user-space, you can write a patch
>>>> to iproute2 to add this check in 'ip mptcp'.
>>>
>>> Or add this check in mptcp_pm_parse_addr, something like:
>>>
>>> $ git diff net/mptcp/pm_netlink.c
>>> diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
>>> index 6ba040897738..9cd4a4180a2a 100644
>>> --- a/net/mptcp/pm_netlink.c
>>> +++ b/net/mptcp/pm_netlink.c
>>> @@ -971,8 +971,14 @@ static int mptcp_pm_parse_addr(struct nlattr
>>> *attr, struct genl_info *info,
>>>         if (tb[MPTCP_PM_ADDR_ATTR_FLAGS])
>>>                 entry->flags = nla_get_u32(tb[MPTCP_PM_ADDR_ATTR_FLAGS]);
>>>
>>> -       if (tb[MPTCP_PM_ADDR_ATTR_PORT])
>>> +       if (tb[MPTCP_PM_ADDR_ATTR_PORT]) {
>>> +               if (!(entry->flags & MPTCP_PM_ADDR_FLAG_SIGNAL)) {
>>> +                       NL_SET_ERR_MSG_ATTR("");
>>> +                       return -EINVAL;
>>> +               }
>>> +
>>>                 entry->addr.port =
>>> htons(nla_get_u16(tb[MPTCP_PM_ADDR_ATTR_PORT]));
>>> +       }
>>>
>>>         return 0;
>>>  }
>>>
>>> WDYT?
>>>
>>
>> I think this is better, we can't assume that all user-space tools works correctly.
> 
> I was thinking a bit about that. With the proposed modifications, it
> means that a server will have to send an ADD_ADDR if it wants to accept
> subflows on another port. I guess there will be use-cases where we will
> not want to send ADD_ADDR because we are in a controlled environment or
> we don't want to announce a public ADD_ADDR+port on a specific network.
> 

Hi Matt, do you mean there will be use-cases where using ADD_ADDR+port as local address to initiate
a outgoing subflow join, but not send ADD_ADDR?

> Do we have to support that? Maybe safer to restrict actions for now and
> allow that later if there are needs, no?
> 
> In other words, I guess we should accept the proposed modifications.
> Any other points of view? :)
> 
> Cheers,
> Matt
> 


  reply	other threads:[~2021-04-23  8:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22 10:30 [PATCH] mptcp: create listening socket only if signal flag is set on Jianguo Wu
2021-04-23  4:33 ` Geliang Tang
2021-04-23  6:38   ` Jianguo Wu
2021-04-23  7:17     ` Geliang Tang
2021-04-23  7:27       ` Geliang Tang
2021-04-23  7:41         ` Jianguo Wu
2021-04-23  7:47           ` Geliang Tang
2021-04-23  8:08             ` Jianguo Wu
2021-04-23  8:21           ` Matthieu Baerts
2021-04-23  8:38             ` Jianguo Wu [this message]
2021-04-23 14:02               ` Matthieu Baerts
2021-04-23  8:59             ` Geliang Tang
2021-04-23 14:04               ` Matthieu Baerts
2021-04-23  7:28       ` Jianguo Wu

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=4b4f4935-138d-a6fc-dfdc-3ef059a33c3e@163.com \
    --to=wujianguo106@163.com \
    --cc=geliangtang@gmail.com \
    --cc=matthieu.baerts@tessares.net \
    --cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.