diff options
| author | Srinivasarao P <spathi@codeaurora.org> | 2019-02-27 12:19:37 +0530 |
|---|---|---|
| committer | Srinivasarao P <spathi@codeaurora.org> | 2019-02-27 12:20:28 +0530 |
| commit | 567c084d6267ecef2d65ca2be5b359857a6305d8 (patch) | |
| tree | d550b16fc36c58fba3c9b169a17db3e4182fa9af /net/ipv4 | |
| parent | 119c43587e314ff2ed171b2b5acf70ebd5fbd156 (diff) | |
| parent | cf84cdc1d2b5be6b3e74130a1e7156a26a813fa8 (diff) | |
Merge android-4.4.176 (cf84cdc) into msm-4.4
* refs/heads/tmp-cf84cdc
Linux 4.4.176
KVM: VMX: Fix x2apic check in vmx_msr_bitmap_mode()
ax25: fix possible use-after-free
mISDN: fix a race in dev_expire_timer()
net/x25: do not hold the cpu too long in x25_new_lci()
mfd: as3722: Mark PM functions as __maybe_unused
mfd: as3722: Handle interrupts on suspend
kvm: fix kvm_ioctl_create_device() reference counting (CVE-2019-6974)
x86: livepatch: Treat R_X86_64_PLT32 as R_X86_64_PC32
net: ipv4: use a dedicated counter for icmp_v4 redirect packets
net: stmmac: Fix a race in EEE enable callback
vxlan: test dev->flags & IFF_UP before calling netif_rx()
tcp: clear icsk_backoff in tcp_write_queue_purge()
net: Do not allocate page fragments that are not skb aligned
tcp: tcp_v4_err() should be more careful
net: Add header for usage of fls64()
sky2: Increase D3 delay again
net: Fix for_each_netdev_feature on Big endian
hwmon: (lm80) Fix missing unlock on error in set_fan_div()
vsock: cope with memory allocation failure at socket creation time
net: fix IPv6 prefix route residue
Change-Id: I73009b0e908406e13fe1ce87f9dbe3341f70af98
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
Diffstat (limited to 'net/ipv4')
| -rw-r--r-- | net/ipv4/inetpeer.c | 1 | ||||
| -rw-r--r-- | net/ipv4/route.c | 7 | ||||
| -rw-r--r-- | net/ipv4/tcp.c | 1 | ||||
| -rw-r--r-- | net/ipv4/tcp_ipv4.c | 7 |
4 files changed, 10 insertions, 6 deletions
diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c index 86fa45809540..0c5862914f05 100644 --- a/net/ipv4/inetpeer.c +++ b/net/ipv4/inetpeer.c @@ -448,6 +448,7 @@ relookup: atomic_set(&p->rid, 0); p->metrics[RTAX_LOCK-1] = INETPEER_METRICS_NEW; p->rate_tokens = 0; + p->n_redirects = 0; /* 60*HZ is arbitrary, but chosen enough high so that the first * calculation of tokens is at its maximum. */ diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 75406603fa1e..6d31206e1a18 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -880,13 +880,15 @@ void ip_rt_send_redirect(struct sk_buff *skb) /* No redirected packets during ip_rt_redirect_silence; * reset the algorithm. */ - if (time_after(jiffies, peer->rate_last + ip_rt_redirect_silence)) + if (time_after(jiffies, peer->rate_last + ip_rt_redirect_silence)) { peer->rate_tokens = 0; + peer->n_redirects = 0; + } /* Too many ignored redirects; do not send anything * set dst.rate_last to the last seen redirected packet. */ - if (peer->rate_tokens >= ip_rt_redirect_number) { + if (peer->n_redirects >= ip_rt_redirect_number) { peer->rate_last = jiffies; goto out_put_peer; } @@ -903,6 +905,7 @@ void ip_rt_send_redirect(struct sk_buff *skb) icmp_send(skb, ICMP_REDIRECT, ICMP_REDIR_HOST, gw); peer->rate_last = jiffies; ++peer->rate_tokens; + ++peer->n_redirects; #ifdef CONFIG_IP_ROUTE_VERBOSE if (log_martians && peer->rate_tokens == ip_rt_redirect_number) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 718049f0a295..16d2b59989ec 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2262,7 +2262,6 @@ int tcp_disconnect(struct sock *sk, int flags) tp->write_seq += tp->max_window + 2; if (tp->write_seq == 0) tp->write_seq = 1; - icsk->icsk_backoff = 0; tp->snd_cwnd = 2; icsk->icsk_probes_out = 0; tp->packets_out = 0; diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 21a0fcbd7e64..d1b911cde946 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -466,14 +466,15 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info) if (sock_owned_by_user(sk)) break; + skb = tcp_write_queue_head(sk); + if (WARN_ON_ONCE(!skb)) + break; + icsk->icsk_backoff--; icsk->icsk_rto = tp->srtt_us ? __tcp_set_rto(tp) : TCP_TIMEOUT_INIT; icsk->icsk_rto = inet_csk_rto_backoff(icsk, TCP_RTO_MAX); - skb = tcp_write_queue_head(sk); - BUG_ON(!skb); - remaining = icsk->icsk_rto - min(icsk->icsk_rto, tcp_time_stamp - tcp_skb_timestamp(skb)); |
