aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r--net/ipv4/tcp_input.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index fae78e3eccc4..8ac82b3703ab 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -64,6 +64,7 @@
64#include <linux/mm.h> 64#include <linux/mm.h>
65#include <linux/module.h> 65#include <linux/module.h>
66#include <linux/sysctl.h> 66#include <linux/sysctl.h>
67#include <linux/kernel.h>
67#include <net/dst.h> 68#include <net/dst.h>
68#include <net/tcp.h> 69#include <net/tcp.h>
69#include <net/inet_common.h> 70#include <net/inet_common.h>
@@ -1802,11 +1803,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb,
1802 for (i = used_sacks - 1; i > 0; i--) { 1803 for (i = used_sacks - 1; i > 0; i--) {
1803 for (j = 0; j < i; j++) { 1804 for (j = 0; j < i; j++) {
1804 if (after(sp[j].start_seq, sp[j + 1].start_seq)) { 1805 if (after(sp[j].start_seq, sp[j + 1].start_seq)) {
1805 struct tcp_sack_block tmp; 1806 swap(sp[j], sp[j + 1]);
1806
1807 tmp = sp[j];
1808 sp[j] = sp[j + 1];
1809 sp[j + 1] = tmp;
1810 1807
1811 /* Track where the first SACK block goes to */ 1808 /* Track where the first SACK block goes to */
1812 if (j == first_sack_index) 1809 if (j == first_sack_index)
@@ -4156,20 +4153,6 @@ static void tcp_sack_maybe_coalesce(struct tcp_sock *tp)
4156 } 4153 }
4157} 4154}
4158 4155
4159static inline void tcp_sack_swap(struct tcp_sack_block *sack1,
4160 struct tcp_sack_block *sack2)
4161{
4162 __u32 tmp;
4163
4164 tmp = sack1->start_seq;
4165 sack1->start_seq = sack2->start_seq;
4166 sack2->start_seq = tmp;
4167
4168 tmp = sack1->end_seq;
4169 sack1->end_seq = sack2->end_seq;
4170 sack2->end_seq = tmp;
4171}
4172
4173static void tcp_sack_new_ofo_skb(struct sock *sk, u32 seq, u32 end_seq) 4156static void tcp_sack_new_ofo_skb(struct sock *sk, u32 seq, u32 end_seq)
4174{ 4157{
4175 struct tcp_sock *tp = tcp_sk(sk); 4158 struct tcp_sock *tp = tcp_sk(sk);
@@ -4184,7 +4167,7 @@ static void tcp_sack_new_ofo_skb(struct sock *sk, u32 seq, u32 end_seq)
4184 if (tcp_sack_extend(sp, seq, end_seq)) { 4167 if (tcp_sack_extend(sp, seq, end_seq)) {
4185 /* Rotate this_sack to the first one. */ 4168 /* Rotate this_sack to the first one. */
4186 for (; this_sack > 0; this_sack--, sp--) 4169 for (; this_sack > 0; this_sack--, sp--)
4187 tcp_sack_swap(sp, sp - 1); 4170 swap(*sp, *(sp - 1));
4188 if (cur_sacks > 1) 4171 if (cur_sacks > 1)
4189 tcp_sack_maybe_coalesce(tp); 4172 tcp_sack_maybe_coalesce(tp);
4190 return; 4173 return;