From f6efc9d243997ea9c10430a56c3c0425417e53fa Mon Sep 17 00:00:00 2001 From: AlexanderFroemmgen Date: Fri, 7 Dec 2018 17:52:39 +0100 Subject: [PATCH] Fix redundant scheduler for the rt-tree based retransmit queue With 75c119a, a new rt-tree based retransmit queue was introduced. This breaks the assumptions of the redundant scheduler and leads to failures when the scheduler trys to schedule the next packet b ased on the skbs in the send queue. This commit fixes https://github.com/multipath-tcp/mptcp/issues/297 Fixes: c61bc63e8f37 ("Merge tag 'v4.15-rc3' into mptcp_trunk") Signed-off-by: AlexanderFroemmgen Signed-off-by: Christoph Paasch --- net/mptcp/mptcp_redundant.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/mptcp/mptcp_redundant.c b/net/mptcp/mptcp_redundant.c index 830312ea4743f..9aa3b8de2c50f 100644 --- a/net/mptcp/mptcp_redundant.c +++ b/net/mptcp/mptcp_redundant.c @@ -196,15 +196,11 @@ static struct sk_buff *redundant_next_skb_from_queue(struct sk_buff_head *queue, struct sk_buff *previous, struct sock *meta_sk) { - if (skb_queue_empty(queue)) - return NULL; + struct sk_buff *skb; if (!previous) return skb_peek(queue); - if (skb_queue_is_last(queue, previous)) - return NULL; - /* sk_data->skb stores the last scheduled packet for this subflow. * If sk_data->skb was scheduled but not sent (e.g., due to nagle), * we have to schedule it again. @@ -225,7 +221,11 @@ static struct sk_buff *redundant_next_skb_from_queue(struct sk_buff_head *queue, if (tcp_send_head(meta_sk) == previous) return tcp_send_head(meta_sk); - return skb_queue_next(queue, previous); + skb = skb_rb_next(previous); + if (skb) + return skb; + + return tcp_send_head(meta_sk); } static struct sk_buff *redundant_next_segment(struct sock *meta_sk,