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

Commit

Permalink
Mark reinjected packets also in the meta-level sendqueue.
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Paasch <[email protected]>
  • Loading branch information
Christoph Paasch committed Sep 23, 2011
1 parent c75ea67 commit 91674b3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/net/mptcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ void mptcp_fallback(struct sock *master_sk);
void mptcp_clean_rtx_infinite(struct sk_buff *skb, struct sock *sk);
void mptcp_fin(struct multipath_pcb *mpcb);
void mptcp_retransmit_timer(struct sock *meta_sk);
void mptcp_mark_reinjected(struct sock *sk, struct sk_buff *skb);

static inline int mptcp_skb_cloned(const struct sk_buff *skb,
const struct tcp_sock *tp)
Expand Down Expand Up @@ -964,6 +965,7 @@ static inline void mptcp_clean_rtx_queue(struct sock *meta_sk) {}
static inline void mptcp_clean_rtx_infinite(struct sk_buff *skb,
struct sock *sk) {}
static inline void mptcp_retransmit_timer(struct sock *meta_sk) {}
static inline void mptcp_mark_reinjected(struct sock *sk, struct sk_buff *skb) {}
static inline void mptcp_set_rto(struct sock *sk) {}
static inline void mptcp_reset_xmit_timer(struct sock *meta_sk) {}
static inline void mptcp_send_fin(struct sock *meta_sk) {}
Expand Down
20 changes: 20 additions & 0 deletions net/ipv4/mptcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,26 @@ void mptcp_retransmit_timer(struct sock *meta_sk)
meta_icsk->icsk_rto, TCP_RTO_MAX * 2);
}

void mptcp_mark_reinjected(struct sock *sk, struct sk_buff *skb) {
struct sock *meta_sk;
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *skb_it;

if (!tp->mpc)
return;

meta_sk = mptcp_meta_sk(sk);
skb_it = tcp_write_queue_head(meta_sk);

while (skb_it && skb_it != tcp_send_head(meta_sk)) {
if (TCP_SKB_CB(skb_it)->data_seq == TCP_SKB_CB(skb)->data_seq) {
skb_it->path_mask |= PI_TO_FLAG(tp->path_index);
break;
}
skb_it = tcp_write_queue_next(meta_sk, skb_it);
}
}


int mptcp_alloc_mpcb(struct sock *master_sk, struct request_sock *req,
gfp_t flags)
Expand Down
3 changes: 3 additions & 0 deletions net/ipv4/tcp_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -2493,6 +2493,9 @@ static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
BUG_ON(tcp_send_head(sk) != skb);
tcp_event_new_data_sent(sk, skb);
}
if (sk!= subsk && reinject) {
mptcp_mark_reinjected(subsk, skb);
}

if (sk != subsk && (TCP_SKB_CB(skb)->flags & TCPHDR_FIN)) {
struct sock *sk_it, *sk_tmp;
Expand Down

0 comments on commit 91674b3

Please sign in to comment.