netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] mptcp: Initialize map_seq upon subflow establishment
@ 2020-05-11 16:24 Christoph Paasch
  2020-05-11 17:35 ` [MPTCP] " Paolo Abeni
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Paasch @ 2020-05-11 16:24 UTC (permalink / raw)
  To: David Miller, Jakub Kicinski
  Cc: netdev, mptcp, Mat Martineau, Matthieu Baerts

When the other MPTCP-peer uses 32-bit data-sequence numbers, we rely on
map_seq to indicate how to expand to a 64-bit data-sequence number in
expand_seq() when receiving data.

For new subflows, this field is not initialized, thus results in an
"invalid" mapping being discarded.

Fix this by initializing map_seq upon subflow establishment time.

Fixes: f296234c98a8 ("mptcp: Add handling of incoming MP_JOIN requests")
Signed-off-by: Christoph Paasch <cpaasch@apple.com>
---
 net/mptcp/protocol.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index e1f23016ed3f..32ea8d35489a 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1629,6 +1629,8 @@ bool mptcp_finish_join(struct sock *sk)
 
 	ret = mptcp_pm_allow_new_subflow(msk);
 	if (ret) {
+		subflow->map_seq = msk->ack_seq;
+
 		/* active connections are already on conn_list */
 		spin_lock_bh(&msk->join_list_lock);
 		if (!WARN_ON_ONCE(!list_empty(&subflow->node)))
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [MPTCP] [PATCH net] mptcp: Initialize map_seq upon subflow establishment
  2020-05-11 16:24 [PATCH net] mptcp: Initialize map_seq upon subflow establishment Christoph Paasch
@ 2020-05-11 17:35 ` Paolo Abeni
  2020-05-12 19:09   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo Abeni @ 2020-05-11 17:35 UTC (permalink / raw)
  To: Christoph Paasch, David Miller, Jakub Kicinski; +Cc: netdev, mptcp

On Mon, 2020-05-11 at 09:24 -0700, Christoph Paasch wrote:
> When the other MPTCP-peer uses 32-bit data-sequence numbers, we rely on
> map_seq to indicate how to expand to a 64-bit data-sequence number in
> expand_seq() when receiving data.
> 
> For new subflows, this field is not initialized, thus results in an
> "invalid" mapping being discarded.
> 
> Fix this by initializing map_seq upon subflow establishment time.
> 
> Fixes: f296234c98a8 ("mptcp: Add handling of incoming MP_JOIN requests")
> Signed-off-by: Christoph Paasch <cpaasch@apple.com>
> ---
>  net/mptcp/protocol.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index e1f23016ed3f..32ea8d35489a 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -1629,6 +1629,8 @@ bool mptcp_finish_join(struct sock *sk)
>  
>  	ret = mptcp_pm_allow_new_subflow(msk);
>  	if (ret) {
> +		subflow->map_seq = msk->ack_seq;
> +
>  		/* active connections are already on conn_list */
>  		spin_lock_bh(&msk->join_list_lock);
>  		if (!WARN_ON_ONCE(!list_empty(&subflow->node)))

Reviewed-by: Paolo Abeni <pabeni@redhat.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [MPTCP] [PATCH net] mptcp: Initialize map_seq upon subflow establishment
  2020-05-11 17:35 ` [MPTCP] " Paolo Abeni
@ 2020-05-12 19:09   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2020-05-12 19:09 UTC (permalink / raw)
  To: pabeni; +Cc: cpaasch, kuba, netdev, mptcp

From: Paolo Abeni <pabeni@redhat.com>
Date: Mon, 11 May 2020 19:35:21 +0200

> On Mon, 2020-05-11 at 09:24 -0700, Christoph Paasch wrote:
>> When the other MPTCP-peer uses 32-bit data-sequence numbers, we rely on
>> map_seq to indicate how to expand to a 64-bit data-sequence number in
>> expand_seq() when receiving data.
>> 
>> For new subflows, this field is not initialized, thus results in an
>> "invalid" mapping being discarded.
>> 
>> Fix this by initializing map_seq upon subflow establishment time.
>> 
>> Fixes: f296234c98a8 ("mptcp: Add handling of incoming MP_JOIN requests")
>> Signed-off-by: Christoph Paasch <cpaasch@apple.com>
 ...
> Reviewed-by: Paolo Abeni <pabeni@redhat.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-12 19:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-11 16:24 [PATCH net] mptcp: Initialize map_seq upon subflow establishment Christoph Paasch
2020-05-11 17:35 ` [MPTCP] " Paolo Abeni
2020-05-12 19:09   ` David Miller

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).