diff options
author | Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> | 2007-06-15 18:14:04 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-06-15 18:14:04 -0400 |
commit | 7769f4064cd9f4fbae09f071578a051aae83e844 (patch) | |
tree | 3e2206b269344672b8d9e8c1803003726bbf45aa | |
parent | b9ce204f0a265f819d10c943a607746abb62f245 (diff) |
[TCP]: Fix logic breakage due to DSACK separation
Commit 6f74651ae626ec672028587bc700538076dfbefb is found guilty
of breaking DSACK counting, which should be done only for the
SACK block reported by the DSACK instead of every SACK block
that is received along with DSACK information.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv4/tcp_input.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index aaf6f66677f9..69f9f1ef3ef6 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -953,7 +953,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_ | |||
953 | int prior_fackets; | 953 | int prior_fackets; |
954 | u32 lost_retrans = 0; | 954 | u32 lost_retrans = 0; |
955 | int flag = 0; | 955 | int flag = 0; |
956 | int dup_sack = 0; | 956 | int found_dup_sack = 0; |
957 | int cached_fack_count; | 957 | int cached_fack_count; |
958 | int i; | 958 | int i; |
959 | int first_sack_index; | 959 | int first_sack_index; |
@@ -964,20 +964,20 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_ | |||
964 | 964 | ||
965 | /* Check for D-SACK. */ | 965 | /* Check for D-SACK. */ |
966 | if (before(ntohl(sp[0].start_seq), TCP_SKB_CB(ack_skb)->ack_seq)) { | 966 | if (before(ntohl(sp[0].start_seq), TCP_SKB_CB(ack_skb)->ack_seq)) { |
967 | dup_sack = 1; | 967 | found_dup_sack = 1; |
968 | tp->rx_opt.sack_ok |= 4; | 968 | tp->rx_opt.sack_ok |= 4; |
969 | NET_INC_STATS_BH(LINUX_MIB_TCPDSACKRECV); | 969 | NET_INC_STATS_BH(LINUX_MIB_TCPDSACKRECV); |
970 | } else if (num_sacks > 1 && | 970 | } else if (num_sacks > 1 && |
971 | !after(ntohl(sp[0].end_seq), ntohl(sp[1].end_seq)) && | 971 | !after(ntohl(sp[0].end_seq), ntohl(sp[1].end_seq)) && |
972 | !before(ntohl(sp[0].start_seq), ntohl(sp[1].start_seq))) { | 972 | !before(ntohl(sp[0].start_seq), ntohl(sp[1].start_seq))) { |
973 | dup_sack = 1; | 973 | found_dup_sack = 1; |
974 | tp->rx_opt.sack_ok |= 4; | 974 | tp->rx_opt.sack_ok |= 4; |
975 | NET_INC_STATS_BH(LINUX_MIB_TCPDSACKOFORECV); | 975 | NET_INC_STATS_BH(LINUX_MIB_TCPDSACKOFORECV); |
976 | } | 976 | } |
977 | 977 | ||
978 | /* D-SACK for already forgotten data... | 978 | /* D-SACK for already forgotten data... |
979 | * Do dumb counting. */ | 979 | * Do dumb counting. */ |
980 | if (dup_sack && | 980 | if (found_dup_sack && |
981 | !after(ntohl(sp[0].end_seq), prior_snd_una) && | 981 | !after(ntohl(sp[0].end_seq), prior_snd_una) && |
982 | after(ntohl(sp[0].end_seq), tp->undo_marker)) | 982 | after(ntohl(sp[0].end_seq), tp->undo_marker)) |
983 | tp->undo_retrans--; | 983 | tp->undo_retrans--; |
@@ -1058,6 +1058,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_ | |||
1058 | __u32 start_seq = ntohl(sp->start_seq); | 1058 | __u32 start_seq = ntohl(sp->start_seq); |
1059 | __u32 end_seq = ntohl(sp->end_seq); | 1059 | __u32 end_seq = ntohl(sp->end_seq); |
1060 | int fack_count; | 1060 | int fack_count; |
1061 | int dup_sack = (found_dup_sack && (i == first_sack_index)); | ||
1061 | 1062 | ||
1062 | skb = cached_skb; | 1063 | skb = cached_skb; |
1063 | fack_count = cached_fack_count; | 1064 | fack_count = cached_fack_count; |