Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
mptcp: Initialize tcp_rtx_queue when creating a new socket
Browse files Browse the repository at this point in the history
When we clone from the meta-sk, it may have data in the rtx-queue. So,
we need to reinitialize it for the subflows as they need a clean
rtx-queue.

Also, move the out_of_order_queue initialization to
tcp_create_openreq_child, to have all of it in one place.

Fixes: c61bc63 ("Merge tag 'v4.15-rc3' into mptcp_trunk")
Signed-off-by: Christoph Paasch <cpaasch@apple.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
  • Loading branch information
cpaasch authored and matttbe committed Feb 9, 2018
1 parent cdb1b92 commit b4dd961
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions net/ipv4/tcp_minisocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,8 @@ struct sock *tcp_create_openreq_child(const struct sock *sk,
newtp->snd_sml = newtp->snd_una =
newtp->snd_nxt = newtp->snd_up = treq->snt_isn + 1;

newtp->out_of_order_queue = RB_ROOT;
newsk->tcp_rtx_queue = RB_ROOT;
INIT_LIST_HEAD(&newtp->tsq_node);
INIT_LIST_HEAD(&newtp->tsorted_sent_queue);

Expand Down
2 changes: 1 addition & 1 deletion net/mptcp/mptcp_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1204,6 +1204,7 @@ static int mptcp_alloc_mpcb(struct sock *meta_sk, __u64 remote_key,
/* Initialize the queues */
skb_queue_head_init(&mpcb->reinject_queue);
master_tp->out_of_order_queue = RB_ROOT;
master_sk->tcp_rtx_queue = RB_ROOT;
INIT_LIST_HEAD(&master_tp->tsq_node);
INIT_LIST_HEAD(&master_tp->tsorted_sent_queue);

Expand Down Expand Up @@ -2171,7 +2172,6 @@ struct sock *mptcp_check_req_child(struct sock *meta_sk,
child_tp->mptcp->init_rcv_wnd = req->rsk_rcv_wnd;

child->sk_tsq_flags = 0;
child_tp->out_of_order_queue = RB_ROOT;

sock_rps_save_rxhash(child, skb);
tcp_synack_rtt_meas(child, req);
Expand Down

0 comments on commit b4dd961

Please sign in to comment.