Skip to content

Commit

Permalink
mptcp: Fix incorrect DSS-checksum on retransmitted TFO-data
Browse files Browse the repository at this point in the history
When TFO is used, skb->ip_summed is set to CHECKSUM_PARTIAL on the
SYN-data. Thus, when TFO fails and we end up retransmitting the data, we
need to recompute the checksum if DSS-csum has been negotiated.

Fixes: 0a71d17 (mptcp: fastopen client support)
Reported-by: Krishna Khanal <[email protected]>
Signed-off-by: Christoph Paasch <[email protected]>
Signed-off-by: Matthieu Baerts <[email protected]>
(cherry picked from commit a0ccde9)
Signed-off-by: Matthieu Baerts <[email protected]>
  • Loading branch information
cpaasch authored and matttbe committed Jul 14, 2017
1 parent d3fc75b commit fdf9b07
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions net/mptcp/mptcp_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,14 @@ static bool mptcp_skb_entail(struct sock *sk, struct sk_buff *skb, int reinject)

TCP_SKB_CB(skb)->path_mask |= mptcp_pi_to_flag(tp->mptcp->path_index);

if (!(sk->sk_route_caps & NETIF_F_ALL_CSUM) &&
skb->ip_summed == CHECKSUM_PARTIAL) {
/* Compute checksum, if:
* 1. The current route does not support csum offloading but it was
* assumed that it does (ip_summed is CHECKSUM_PARTIAL)
* 2. We need the DSS-checksum but ended up not pre-computing it
* (e.g., in the case of TFO retransmissions).
*/
if (skb->ip_summed == CHECKSUM_PARTIAL &&
(!(sk->sk_route_caps & NETIF_F_ALL_CSUM) || tp->mpcb->dss_csum)) {
subskb->csum = skb->csum = skb_checksum(skb, 0, skb->len, 0);
subskb->ip_summed = skb->ip_summed = CHECKSUM_NONE;
}
Expand Down

0 comments on commit fdf9b07

Please sign in to comment.