diff options
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/ip_tunnel.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_cubic.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 14 |
3 files changed, 10 insertions, 8 deletions
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index fa5b7519765f..b3f859731c60 100644 --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c | |||
@@ -442,6 +442,8 @@ int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb, | |||
442 | tunnel->i_seqno = ntohl(tpi->seq) + 1; | 442 | tunnel->i_seqno = ntohl(tpi->seq) + 1; |
443 | } | 443 | } |
444 | 444 | ||
445 | skb_reset_network_header(skb); | ||
446 | |||
445 | err = IP_ECN_decapsulate(iph, skb); | 447 | err = IP_ECN_decapsulate(iph, skb); |
446 | if (unlikely(err)) { | 448 | if (unlikely(err)) { |
447 | if (log_ecn_error) | 449 | if (log_ecn_error) |
diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c index 8bf224516ba2..b4f1b29b08bd 100644 --- a/net/ipv4/tcp_cubic.c +++ b/net/ipv4/tcp_cubic.c | |||
@@ -409,7 +409,7 @@ static void bictcp_acked(struct sock *sk, u32 cnt, s32 rtt_us) | |||
409 | ratio -= ca->delayed_ack >> ACK_RATIO_SHIFT; | 409 | ratio -= ca->delayed_ack >> ACK_RATIO_SHIFT; |
410 | ratio += cnt; | 410 | ratio += cnt; |
411 | 411 | ||
412 | ca->delayed_ack = min(ratio, ACK_RATIO_LIMIT); | 412 | ca->delayed_ack = clamp(ratio, 1U, ACK_RATIO_LIMIT); |
413 | } | 413 | } |
414 | 414 | ||
415 | /* Some calls are for duplicates without timetamps */ | 415 | /* Some calls are for duplicates without timetamps */ |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 025e25093984..12d6016bdd9a 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -2441,8 +2441,14 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb) | |||
2441 | err = tcp_transmit_skb(sk, skb, 1, GFP_ATOMIC); | 2441 | err = tcp_transmit_skb(sk, skb, 1, GFP_ATOMIC); |
2442 | } | 2442 | } |
2443 | 2443 | ||
2444 | if (likely(!err)) | 2444 | if (likely(!err)) { |
2445 | TCP_SKB_CB(skb)->sacked |= TCPCB_EVER_RETRANS; | 2445 | TCP_SKB_CB(skb)->sacked |= TCPCB_EVER_RETRANS; |
2446 | /* Update global TCP statistics. */ | ||
2447 | TCP_INC_STATS(sock_net(sk), TCP_MIB_RETRANSSEGS); | ||
2448 | if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_SYN) | ||
2449 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPSYNRETRANS); | ||
2450 | tp->total_retrans++; | ||
2451 | } | ||
2446 | return err; | 2452 | return err; |
2447 | } | 2453 | } |
2448 | 2454 | ||
@@ -2452,12 +2458,6 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb) | |||
2452 | int err = __tcp_retransmit_skb(sk, skb); | 2458 | int err = __tcp_retransmit_skb(sk, skb); |
2453 | 2459 | ||
2454 | if (err == 0) { | 2460 | if (err == 0) { |
2455 | /* Update global TCP statistics. */ | ||
2456 | TCP_INC_STATS(sock_net(sk), TCP_MIB_RETRANSSEGS); | ||
2457 | if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_SYN) | ||
2458 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPSYNRETRANS); | ||
2459 | tp->total_retrans++; | ||
2460 | |||
2461 | #if FASTRETRANS_DEBUG > 0 | 2461 | #if FASTRETRANS_DEBUG > 0 |
2462 | if (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_RETRANS) { | 2462 | if (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_RETRANS) { |
2463 | net_dbg_ratelimited("retrans_out leaked\n"); | 2463 | net_dbg_ratelimited("retrans_out leaked\n"); |