aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-08-23 05:43:14 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2007-08-23 05:43:14 -0400
commitac0c955d5048c2c580fa7166a89133f0fd76c125 (patch)
tree041ac4fb544c7244a1a0b35c8ceabc142d5645c1 /net/ipv4
parent68d09b1b6780415d82160f6b6d88e82bd724e691 (diff)
parentb377fd3982ad957c796758a90e2988401a884241 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/af_inet.c2
-rw-r--r--net/ipv4/ip_output.c1
-rw-r--r--net/ipv4/ipconfig.c6
-rw-r--r--net/ipv4/ipvs/ip_vs_ctl.c3
-rw-r--r--net/ipv4/netfilter/ipt_CLUSTERIP.c1
-rw-r--r--net/ipv4/netfilter/ipt_recent.c7
-rw-r--r--net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c6
-rw-r--r--net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c5
-rw-r--r--net/ipv4/netfilter/nf_nat_sip.c2
-rw-r--r--net/ipv4/netfilter/nf_nat_standalone.c2
-rw-r--r--net/ipv4/raw.c4
-rw-r--r--net/ipv4/route.c4
-rw-r--r--net/ipv4/tcp.c3
-rw-r--r--net/ipv4/tcp_htcp.c4
-rw-r--r--net/ipv4/tcp_input.c37
-rw-r--r--net/ipv4/tcp_ipv4.c1
16 files changed, 49 insertions, 39 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 06c08e5740fb..e68103475cca 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -831,7 +831,7 @@ const struct proto_ops inet_stream_ops = {
831 .shutdown = inet_shutdown, 831 .shutdown = inet_shutdown,
832 .setsockopt = sock_common_setsockopt, 832 .setsockopt = sock_common_setsockopt,
833 .getsockopt = sock_common_getsockopt, 833 .getsockopt = sock_common_getsockopt,
834 .sendmsg = inet_sendmsg, 834 .sendmsg = tcp_sendmsg,
835 .recvmsg = sock_common_recvmsg, 835 .recvmsg = sock_common_recvmsg,
836 .mmap = sock_no_mmap, 836 .mmap = sock_no_mmap,
837 .sendpage = tcp_sendpage, 837 .sendpage = tcp_sendpage,
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index c9e2b5e6305e..0f1d7beacf78 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -75,7 +75,6 @@
75#include <net/icmp.h> 75#include <net/icmp.h>
76#include <net/checksum.h> 76#include <net/checksum.h>
77#include <net/inetpeer.h> 77#include <net/inetpeer.h>
78#include <net/checksum.h>
79#include <linux/igmp.h> 78#include <linux/igmp.h>
80#include <linux/netfilter_ipv4.h> 79#include <linux/netfilter_ipv4.h>
81#include <linux/netfilter_bridge.h> 80#include <linux/netfilter_bridge.h>
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 342ca8d89458..c5b247077539 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -1281,9 +1281,9 @@ static int __init ip_auto_config(void)
1281 */ 1281 */
1282 if (ic_myaddr == NONE || 1282 if (ic_myaddr == NONE ||
1283#ifdef CONFIG_ROOT_NFS 1283#ifdef CONFIG_ROOT_NFS
1284 (MAJOR(ROOT_DEV) == UNNAMED_MAJOR 1284 (root_server_addr == NONE
1285 && root_server_addr == NONE 1285 && ic_servaddr == NONE
1286 && ic_servaddr == NONE) || 1286 && ROOT_DEV == Root_NFS) ||
1287#endif 1287#endif
1288 ic_first_dev->next) { 1288 ic_first_dev->next) {
1289#ifdef IPCONFIG_DYNAMIC 1289#ifdef IPCONFIG_DYNAMIC
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c
index e1052bcf4ed1..902fd578aa3c 100644
--- a/net/ipv4/ipvs/ip_vs_ctl.c
+++ b/net/ipv4/ipvs/ip_vs_ctl.c
@@ -29,7 +29,6 @@
29#include <linux/proc_fs.h> 29#include <linux/proc_fs.h>
30#include <linux/workqueue.h> 30#include <linux/workqueue.h>
31#include <linux/swap.h> 31#include <linux/swap.h>
32#include <linux/proc_fs.h>
33#include <linux/seq_file.h> 32#include <linux/seq_file.h>
34 33
35#include <linux/netfilter.h> 34#include <linux/netfilter.h>
@@ -909,7 +908,7 @@ ip_vs_edit_dest(struct ip_vs_service *svc, struct ip_vs_dest_user *udest)
909 write_lock_bh(&__ip_vs_svc_lock); 908 write_lock_bh(&__ip_vs_svc_lock);
910 909
911 /* Wait until all other svc users go away */ 910 /* Wait until all other svc users go away */
912 while (atomic_read(&svc->usecnt) > 1) {}; 911 IP_VS_WAIT_WHILE(atomic_read(&svc->usecnt) > 1);
913 912
914 /* call the update_service, because server weight may be changed */ 913 /* call the update_service, because server weight may be changed */
915 svc->scheduler->update_service(svc); 914 svc->scheduler->update_service(svc);
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
index dcc12b183474..69bd362b5fa2 100644
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -19,7 +19,6 @@
19#include <linux/udp.h> 19#include <linux/udp.h>
20#include <linux/icmp.h> 20#include <linux/icmp.h>
21#include <linux/if_arp.h> 21#include <linux/if_arp.h>
22#include <linux/proc_fs.h>
23#include <linux/seq_file.h> 22#include <linux/seq_file.h>
24#include <linux/netfilter_arp.h> 23#include <linux/netfilter_arp.h>
25#include <linux/netfilter/x_tables.h> 24#include <linux/netfilter/x_tables.h>
diff --git a/net/ipv4/netfilter/ipt_recent.c b/net/ipv4/netfilter/ipt_recent.c
index 321804315659..6d0c0f7364ad 100644
--- a/net/ipv4/netfilter/ipt_recent.c
+++ b/net/ipv4/netfilter/ipt_recent.c
@@ -387,12 +387,17 @@ static int recent_seq_open(struct inode *inode, struct file *file)
387 st = kzalloc(sizeof(*st), GFP_KERNEL); 387 st = kzalloc(sizeof(*st), GFP_KERNEL);
388 if (st == NULL) 388 if (st == NULL)
389 return -ENOMEM; 389 return -ENOMEM;
390
390 ret = seq_open(file, &recent_seq_ops); 391 ret = seq_open(file, &recent_seq_ops);
391 if (ret) 392 if (ret) {
392 kfree(st); 393 kfree(st);
394 goto out;
395 }
396
393 st->table = pde->data; 397 st->table = pde->data;
394 seq = file->private_data; 398 seq = file->private_data;
395 seq->private = st; 399 seq->private = st;
400out:
396 return ret; 401 return ret;
397} 402}
398 403
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
index 64552afd01cb..d9b5177989c6 100644
--- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
+++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
@@ -509,3 +509,9 @@ static void __exit nf_conntrack_l3proto_ipv4_fini(void)
509 509
510module_init(nf_conntrack_l3proto_ipv4_init); 510module_init(nf_conntrack_l3proto_ipv4_init);
511module_exit(nf_conntrack_l3proto_ipv4_fini); 511module_exit(nf_conntrack_l3proto_ipv4_fini);
512
513void need_ipv4_conntrack(void)
514{
515 return;
516}
517EXPORT_SYMBOL_GPL(need_ipv4_conntrack);
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
index 27c7918e442a..b3dd5de9a258 100644
--- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
+++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
@@ -294,15 +294,14 @@ static int exp_open(struct inode *inode, struct file *file)
294 struct ct_expect_iter_state *st; 294 struct ct_expect_iter_state *st;
295 int ret; 295 int ret;
296 296
297 st = kmalloc(sizeof(struct ct_expect_iter_state), GFP_KERNEL); 297 st = kzalloc(sizeof(struct ct_expect_iter_state), GFP_KERNEL);
298 if (st == NULL) 298 if (!st)
299 return -ENOMEM; 299 return -ENOMEM;
300 ret = seq_open(file, &exp_seq_ops); 300 ret = seq_open(file, &exp_seq_ops);
301 if (ret) 301 if (ret)
302 goto out_free; 302 goto out_free;
303 seq = file->private_data; 303 seq = file->private_data;
304 seq->private = st; 304 seq->private = st;
305 memset(st, 0, sizeof(struct ct_expect_iter_state));
306 return ret; 305 return ret;
307out_free: 306out_free:
308 kfree(st); 307 kfree(st);
diff --git a/net/ipv4/netfilter/nf_nat_sip.c b/net/ipv4/netfilter/nf_nat_sip.c
index a889ec3ec83a..e14d41976c27 100644
--- a/net/ipv4/netfilter/nf_nat_sip.c
+++ b/net/ipv4/netfilter/nf_nat_sip.c
@@ -104,7 +104,7 @@ static unsigned int ip_nat_sip(struct sk_buff **pskb,
104 dataoff = ip_hdrlen(*pskb) + sizeof(struct udphdr); 104 dataoff = ip_hdrlen(*pskb) + sizeof(struct udphdr);
105 datalen = (*pskb)->len - dataoff; 105 datalen = (*pskb)->len - dataoff;
106 if (datalen < sizeof("SIP/2.0") - 1) 106 if (datalen < sizeof("SIP/2.0") - 1)
107 return NF_DROP; 107 return NF_ACCEPT;
108 108
109 addr_map_init(ct, &map); 109 addr_map_init(ct, &map);
110 110
diff --git a/net/ipv4/netfilter/nf_nat_standalone.c b/net/ipv4/netfilter/nf_nat_standalone.c
index 332814dac503..46cc99def165 100644
--- a/net/ipv4/netfilter/nf_nat_standalone.c
+++ b/net/ipv4/netfilter/nf_nat_standalone.c
@@ -328,7 +328,7 @@ static int __init nf_nat_standalone_init(void)
328{ 328{
329 int ret = 0; 329 int ret = 0;
330 330
331 need_conntrack(); 331 need_ipv4_conntrack();
332 332
333#ifdef CONFIG_XFRM 333#ifdef CONFIG_XFRM
334 BUG_ON(ip_nat_decode_session != NULL); 334 BUG_ON(ip_nat_decode_session != NULL);
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 24d7c9f31918..c6d71526f625 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -900,8 +900,9 @@ static int raw_seq_open(struct inode *inode, struct file *file)
900{ 900{
901 struct seq_file *seq; 901 struct seq_file *seq;
902 int rc = -ENOMEM; 902 int rc = -ENOMEM;
903 struct raw_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL); 903 struct raw_iter_state *s;
904 904
905 s = kzalloc(sizeof(*s), GFP_KERNEL);
905 if (!s) 906 if (!s)
906 goto out; 907 goto out;
907 rc = seq_open(file, &raw_seq_ops); 908 rc = seq_open(file, &raw_seq_ops);
@@ -910,7 +911,6 @@ static int raw_seq_open(struct inode *inode, struct file *file)
910 911
911 seq = file->private_data; 912 seq = file->private_data;
912 seq->private = s; 913 seq->private = s;
913 memset(s, 0, sizeof(*s));
914out: 914out:
915 return rc; 915 return rc;
916out_kfree: 916out_kfree:
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index df42b7fb3268..c7ca94bd152c 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -374,8 +374,9 @@ static int rt_cache_seq_open(struct inode *inode, struct file *file)
374{ 374{
375 struct seq_file *seq; 375 struct seq_file *seq;
376 int rc = -ENOMEM; 376 int rc = -ENOMEM;
377 struct rt_cache_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL); 377 struct rt_cache_iter_state *s;
378 378
379 s = kzalloc(sizeof(*s), GFP_KERNEL);
379 if (!s) 380 if (!s)
380 goto out; 381 goto out;
381 rc = seq_open(file, &rt_cache_seq_ops); 382 rc = seq_open(file, &rt_cache_seq_ops);
@@ -383,7 +384,6 @@ static int rt_cache_seq_open(struct inode *inode, struct file *file)
383 goto out_kfree; 384 goto out_kfree;
384 seq = file->private_data; 385 seq = file->private_data;
385 seq->private = s; 386 seq->private = s;
386 memset(s, 0, sizeof(*s));
387out: 387out:
388 return rc; 388 return rc;
389out_kfree: 389out_kfree:
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index da4c0b6ab79a..7e740112b238 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -658,9 +658,10 @@ static inline int select_size(struct sock *sk)
658 return tmp; 658 return tmp;
659} 659}
660 660
661int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, 661int tcp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
662 size_t size) 662 size_t size)
663{ 663{
664 struct sock *sk = sock->sk;
664 struct iovec *iov; 665 struct iovec *iov;
665 struct tcp_sock *tp = tcp_sk(sk); 666 struct tcp_sock *tp = tcp_sk(sk);
666 struct sk_buff *skb; 667 struct sk_buff *skb;
diff --git a/net/ipv4/tcp_htcp.c b/net/ipv4/tcp_htcp.c
index b66556c0a5bd..5215691f2760 100644
--- a/net/ipv4/tcp_htcp.c
+++ b/net/ipv4/tcp_htcp.c
@@ -79,7 +79,6 @@ static u32 htcp_cwnd_undo(struct sock *sk)
79static inline void measure_rtt(struct sock *sk, u32 srtt) 79static inline void measure_rtt(struct sock *sk, u32 srtt)
80{ 80{
81 const struct inet_connection_sock *icsk = inet_csk(sk); 81 const struct inet_connection_sock *icsk = inet_csk(sk);
82 const struct tcp_sock *tp = tcp_sk(sk);
83 struct htcp *ca = inet_csk_ca(sk); 82 struct htcp *ca = inet_csk_ca(sk);
84 83
85 /* keep track of minimum RTT seen so far, minRTT is zero at first */ 84 /* keep track of minimum RTT seen so far, minRTT is zero at first */
@@ -87,8 +86,7 @@ static inline void measure_rtt(struct sock *sk, u32 srtt)
87 ca->minRTT = srtt; 86 ca->minRTT = srtt;
88 87
89 /* max RTT */ 88 /* max RTT */
90 if (icsk->icsk_ca_state == TCP_CA_Open 89 if (icsk->icsk_ca_state == TCP_CA_Open) {
91 && tp->snd_ssthresh < 0xFFFF && htcp_ccount(ca) > 3) {
92 if (ca->maxRTT < ca->minRTT) 90 if (ca->maxRTT < ca->minRTT)
93 ca->maxRTT = ca->minRTT; 91 ca->maxRTT = ca->minRTT;
94 if (ca->maxRTT < srtt 92 if (ca->maxRTT < srtt
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 378ca8a086a3..f030435e0eb4 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -102,11 +102,14 @@ int sysctl_tcp_abc __read_mostly;
102#define FLAG_DATA_LOST 0x80 /* SACK detected data lossage. */ 102#define FLAG_DATA_LOST 0x80 /* SACK detected data lossage. */
103#define FLAG_SLOWPATH 0x100 /* Do not skip RFC checks for window update.*/ 103#define FLAG_SLOWPATH 0x100 /* Do not skip RFC checks for window update.*/
104#define FLAG_ONLY_ORIG_SACKED 0x200 /* SACKs only non-rexmit sent before RTO */ 104#define FLAG_ONLY_ORIG_SACKED 0x200 /* SACKs only non-rexmit sent before RTO */
105#define FLAG_SND_UNA_ADVANCED 0x400 /* Snd_una was changed (!= FLAG_DATA_ACKED) */
106#define FLAG_DSACKING_ACK 0x800 /* SACK blocks contained DSACK info */
105 107
106#define FLAG_ACKED (FLAG_DATA_ACKED|FLAG_SYN_ACKED) 108#define FLAG_ACKED (FLAG_DATA_ACKED|FLAG_SYN_ACKED)
107#define FLAG_NOT_DUP (FLAG_DATA|FLAG_WIN_UPDATE|FLAG_ACKED) 109#define FLAG_NOT_DUP (FLAG_DATA|FLAG_WIN_UPDATE|FLAG_ACKED)
108#define FLAG_CA_ALERT (FLAG_DATA_SACKED|FLAG_ECE) 110#define FLAG_CA_ALERT (FLAG_DATA_SACKED|FLAG_ECE)
109#define FLAG_FORWARD_PROGRESS (FLAG_ACKED|FLAG_DATA_SACKED) 111#define FLAG_FORWARD_PROGRESS (FLAG_ACKED|FLAG_DATA_SACKED)
112#define FLAG_ANY_PROGRESS (FLAG_FORWARD_PROGRESS|FLAG_SND_UNA_ADVANCED)
110 113
111#define IsReno(tp) ((tp)->rx_opt.sack_ok == 0) 114#define IsReno(tp) ((tp)->rx_opt.sack_ok == 0)
112#define IsFack(tp) ((tp)->rx_opt.sack_ok & 2) 115#define IsFack(tp) ((tp)->rx_opt.sack_ok & 2)
@@ -964,12 +967,14 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
964 967
965 /* Check for D-SACK. */ 968 /* Check for D-SACK. */
966 if (before(ntohl(sp[0].start_seq), TCP_SKB_CB(ack_skb)->ack_seq)) { 969 if (before(ntohl(sp[0].start_seq), TCP_SKB_CB(ack_skb)->ack_seq)) {
970 flag |= FLAG_DSACKING_ACK;
967 found_dup_sack = 1; 971 found_dup_sack = 1;
968 tp->rx_opt.sack_ok |= 4; 972 tp->rx_opt.sack_ok |= 4;
969 NET_INC_STATS_BH(LINUX_MIB_TCPDSACKRECV); 973 NET_INC_STATS_BH(LINUX_MIB_TCPDSACKRECV);
970 } else if (num_sacks > 1 && 974 } else if (num_sacks > 1 &&
971 !after(ntohl(sp[0].end_seq), ntohl(sp[1].end_seq)) && 975 !after(ntohl(sp[0].end_seq), ntohl(sp[1].end_seq)) &&
972 !before(ntohl(sp[0].start_seq), ntohl(sp[1].start_seq))) { 976 !before(ntohl(sp[0].start_seq), ntohl(sp[1].start_seq))) {
977 flag |= FLAG_DSACKING_ACK;
973 found_dup_sack = 1; 978 found_dup_sack = 1;
974 tp->rx_opt.sack_ok |= 4; 979 tp->rx_opt.sack_ok |= 4;
975 NET_INC_STATS_BH(LINUX_MIB_TCPDSACKOFORECV); 980 NET_INC_STATS_BH(LINUX_MIB_TCPDSACKOFORECV);
@@ -1856,7 +1861,7 @@ static void tcp_cwnd_down(struct sock *sk, int flag)
1856 struct tcp_sock *tp = tcp_sk(sk); 1861 struct tcp_sock *tp = tcp_sk(sk);
1857 int decr = tp->snd_cwnd_cnt + 1; 1862 int decr = tp->snd_cwnd_cnt + 1;
1858 1863
1859 if ((flag&FLAG_FORWARD_PROGRESS) || 1864 if ((flag&(FLAG_ANY_PROGRESS|FLAG_DSACKING_ACK)) ||
1860 (IsReno(tp) && !(flag&FLAG_NOT_DUP))) { 1865 (IsReno(tp) && !(flag&FLAG_NOT_DUP))) {
1861 tp->snd_cwnd_cnt = decr&1; 1866 tp->snd_cwnd_cnt = decr&1;
1862 decr >>= 1; 1867 decr >>= 1;
@@ -2107,15 +2112,13 @@ static void tcp_mtup_probe_success(struct sock *sk, struct sk_buff *skb)
2107 * tcp_xmit_retransmit_queue(). 2112 * tcp_xmit_retransmit_queue().
2108 */ 2113 */
2109static void 2114static void
2110tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una, 2115tcp_fastretrans_alert(struct sock *sk, int prior_packets, int flag)
2111 int prior_packets, int flag)
2112{ 2116{
2113 struct inet_connection_sock *icsk = inet_csk(sk); 2117 struct inet_connection_sock *icsk = inet_csk(sk);
2114 struct tcp_sock *tp = tcp_sk(sk); 2118 struct tcp_sock *tp = tcp_sk(sk);
2115 int is_dupack = (tp->snd_una == prior_snd_una && 2119 int is_dupack = !(flag&(FLAG_SND_UNA_ADVANCED|FLAG_NOT_DUP));
2116 (!(flag&FLAG_NOT_DUP) || 2120 int do_lost = is_dupack || ((flag&FLAG_DATA_SACKED) &&
2117 ((flag&FLAG_DATA_SACKED) && 2121 (tp->fackets_out > tp->reordering));
2118 (tp->fackets_out > tp->reordering))));
2119 2122
2120 /* Some technical things: 2123 /* Some technical things:
2121 * 1. Reno does not count dupacks (sacked_out) automatically. */ 2124 * 1. Reno does not count dupacks (sacked_out) automatically. */
@@ -2192,14 +2195,14 @@ tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una,
2192 /* F. Process state. */ 2195 /* F. Process state. */
2193 switch (icsk->icsk_ca_state) { 2196 switch (icsk->icsk_ca_state) {
2194 case TCP_CA_Recovery: 2197 case TCP_CA_Recovery:
2195 if (prior_snd_una == tp->snd_una) { 2198 if (!(flag & FLAG_SND_UNA_ADVANCED)) {
2196 if (IsReno(tp) && is_dupack) 2199 if (IsReno(tp) && is_dupack)
2197 tcp_add_reno_sack(sk); 2200 tcp_add_reno_sack(sk);
2198 } else { 2201 } else {
2199 int acked = prior_packets - tp->packets_out; 2202 int acked = prior_packets - tp->packets_out;
2200 if (IsReno(tp)) 2203 if (IsReno(tp))
2201 tcp_remove_reno_sacks(sk, acked); 2204 tcp_remove_reno_sacks(sk, acked);
2202 is_dupack = tcp_try_undo_partial(sk, acked); 2205 do_lost = tcp_try_undo_partial(sk, acked);
2203 } 2206 }
2204 break; 2207 break;
2205 case TCP_CA_Loss: 2208 case TCP_CA_Loss:
@@ -2215,7 +2218,7 @@ tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una,
2215 /* Loss is undone; fall through to processing in Open state. */ 2218 /* Loss is undone; fall through to processing in Open state. */
2216 default: 2219 default:
2217 if (IsReno(tp)) { 2220 if (IsReno(tp)) {
2218 if (tp->snd_una != prior_snd_una) 2221 if (flag & FLAG_SND_UNA_ADVANCED)
2219 tcp_reset_reno_sack(tp); 2222 tcp_reset_reno_sack(tp);
2220 if (is_dupack) 2223 if (is_dupack)
2221 tcp_add_reno_sack(sk); 2224 tcp_add_reno_sack(sk);
@@ -2264,7 +2267,7 @@ tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una,
2264 tcp_set_ca_state(sk, TCP_CA_Recovery); 2267 tcp_set_ca_state(sk, TCP_CA_Recovery);
2265 } 2268 }
2266 2269
2267 if (is_dupack || tcp_head_timedout(sk)) 2270 if (do_lost || tcp_head_timedout(sk))
2268 tcp_update_scoreboard(sk); 2271 tcp_update_scoreboard(sk);
2269 tcp_cwnd_down(sk, flag); 2272 tcp_cwnd_down(sk, flag);
2270 tcp_xmit_retransmit_queue(sk); 2273 tcp_xmit_retransmit_queue(sk);
@@ -2684,7 +2687,7 @@ static void tcp_undo_spur_to_response(struct sock *sk, int flag)
2684 * to prove that the RTO is indeed spurious. It transfers the control 2687 * to prove that the RTO is indeed spurious. It transfers the control
2685 * from F-RTO to the conventional RTO recovery 2688 * from F-RTO to the conventional RTO recovery
2686 */ 2689 */
2687static int tcp_process_frto(struct sock *sk, u32 prior_snd_una, int flag) 2690static int tcp_process_frto(struct sock *sk, int flag)
2688{ 2691{
2689 struct tcp_sock *tp = tcp_sk(sk); 2692 struct tcp_sock *tp = tcp_sk(sk);
2690 2693
@@ -2704,8 +2707,7 @@ static int tcp_process_frto(struct sock *sk, u32 prior_snd_una, int flag)
2704 * ACK isn't duplicate nor advances window, e.g., opposite dir 2707 * ACK isn't duplicate nor advances window, e.g., opposite dir
2705 * data, winupdate 2708 * data, winupdate
2706 */ 2709 */
2707 if ((tp->snd_una == prior_snd_una) && (flag&FLAG_NOT_DUP) && 2710 if (!(flag&FLAG_ANY_PROGRESS) && (flag&FLAG_NOT_DUP))
2708 !(flag&FLAG_FORWARD_PROGRESS))
2709 return 1; 2711 return 1;
2710 2712
2711 if (!(flag&FLAG_DATA_ACKED)) { 2713 if (!(flag&FLAG_DATA_ACKED)) {
@@ -2785,6 +2787,9 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag)
2785 if (before(ack, prior_snd_una)) 2787 if (before(ack, prior_snd_una))
2786 goto old_ack; 2788 goto old_ack;
2787 2789
2790 if (after(ack, prior_snd_una))
2791 flag |= FLAG_SND_UNA_ADVANCED;
2792
2788 if (sysctl_tcp_abc) { 2793 if (sysctl_tcp_abc) {
2789 if (icsk->icsk_ca_state < TCP_CA_CWR) 2794 if (icsk->icsk_ca_state < TCP_CA_CWR)
2790 tp->bytes_acked += ack - prior_snd_una; 2795 tp->bytes_acked += ack - prior_snd_una;
@@ -2837,14 +2842,14 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag)
2837 flag |= tcp_clean_rtx_queue(sk, &seq_rtt); 2842 flag |= tcp_clean_rtx_queue(sk, &seq_rtt);
2838 2843
2839 if (tp->frto_counter) 2844 if (tp->frto_counter)
2840 frto_cwnd = tcp_process_frto(sk, prior_snd_una, flag); 2845 frto_cwnd = tcp_process_frto(sk, flag);
2841 2846
2842 if (tcp_ack_is_dubious(sk, flag)) { 2847 if (tcp_ack_is_dubious(sk, flag)) {
2843 /* Advance CWND, if state allows this. */ 2848 /* Advance CWND, if state allows this. */
2844 if ((flag & FLAG_DATA_ACKED) && !frto_cwnd && 2849 if ((flag & FLAG_DATA_ACKED) && !frto_cwnd &&
2845 tcp_may_raise_cwnd(sk, flag)) 2850 tcp_may_raise_cwnd(sk, flag))
2846 tcp_cong_avoid(sk, ack, prior_in_flight, 0); 2851 tcp_cong_avoid(sk, ack, prior_in_flight, 0);
2847 tcp_fastretrans_alert(sk, prior_snd_una, prior_packets, flag); 2852 tcp_fastretrans_alert(sk, prior_packets, flag);
2848 } else { 2853 } else {
2849 if ((flag & FLAG_DATA_ACKED) && !frto_cwnd) 2854 if ((flag & FLAG_DATA_ACKED) && !frto_cwnd)
2850 tcp_cong_avoid(sk, ack, prior_in_flight, 1); 2855 tcp_cong_avoid(sk, ack, prior_in_flight, 1);
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 3f5f7423b95c..9c94627c8c7e 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -2425,7 +2425,6 @@ struct proto tcp_prot = {
2425 .shutdown = tcp_shutdown, 2425 .shutdown = tcp_shutdown,
2426 .setsockopt = tcp_setsockopt, 2426 .setsockopt = tcp_setsockopt,
2427 .getsockopt = tcp_getsockopt, 2427 .getsockopt = tcp_getsockopt,
2428 .sendmsg = tcp_sendmsg,
2429 .recvmsg = tcp_recvmsg, 2428 .recvmsg = tcp_recvmsg,
2430 .backlog_rcv = tcp_v4_do_rcv, 2429 .backlog_rcv = tcp_v4_do_rcv,
2431 .hash = tcp_v4_hash, 2430 .hash = tcp_v4_hash,