tcp_input.c (717cb906bd43a9ac00631d600adda5c6546843a6) | tcp_input.c (b03efcfb2180289718991bb984044ce6c5b7d1b0) |
---|---|
1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * Implementation of the Transmission Control Protocol(TCP). 7 * 8 * Version: $Id: tcp_input.c,v 1.243 2002/02/01 22:01:04 davem Exp $ --- 2788 unchanged lines hidden (view full) --- 2797 2798static void tcp_sack_remove(struct tcp_sock *tp) 2799{ 2800 struct tcp_sack_block *sp = &tp->selective_acks[0]; 2801 int num_sacks = tp->rx_opt.num_sacks; 2802 int this_sack; 2803 2804 /* Empty ofo queue, hence, all the SACKs are eaten. Clear. */ | 1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * Implementation of the Transmission Control Protocol(TCP). 7 * 8 * Version: $Id: tcp_input.c,v 1.243 2002/02/01 22:01:04 davem Exp $ --- 2788 unchanged lines hidden (view full) --- 2797 2798static void tcp_sack_remove(struct tcp_sock *tp) 2799{ 2800 struct tcp_sack_block *sp = &tp->selective_acks[0]; 2801 int num_sacks = tp->rx_opt.num_sacks; 2802 int this_sack; 2803 2804 /* Empty ofo queue, hence, all the SACKs are eaten. Clear. */ |
2805 if (skb_queue_len(&tp->out_of_order_queue) == 0) { | 2805 if (skb_queue_empty(&tp->out_of_order_queue)) { |
2806 tp->rx_opt.num_sacks = 0; 2807 tp->rx_opt.eff_sacks = tp->rx_opt.dsack; 2808 return; 2809 } 2810 2811 for(this_sack = 0; this_sack < num_sacks; ) { 2812 /* Check if the start of the sack is covered by RCV.NXT. */ 2813 if (!before(tp->rcv_nxt, sp->start_seq)) { --- 116 unchanged lines hidden (view full) --- 2930 __skb_queue_tail(&sk->sk_receive_queue, skb); 2931 } 2932 tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq; 2933 if(skb->len) 2934 tcp_event_data_recv(sk, tp, skb); 2935 if(th->fin) 2936 tcp_fin(skb, sk, th); 2937 | 2806 tp->rx_opt.num_sacks = 0; 2807 tp->rx_opt.eff_sacks = tp->rx_opt.dsack; 2808 return; 2809 } 2810 2811 for(this_sack = 0; this_sack < num_sacks; ) { 2812 /* Check if the start of the sack is covered by RCV.NXT. */ 2813 if (!before(tp->rcv_nxt, sp->start_seq)) { --- 116 unchanged lines hidden (view full) --- 2930 __skb_queue_tail(&sk->sk_receive_queue, skb); 2931 } 2932 tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq; 2933 if(skb->len) 2934 tcp_event_data_recv(sk, tp, skb); 2935 if(th->fin) 2936 tcp_fin(skb, sk, th); 2937 |
2938 if (skb_queue_len(&tp->out_of_order_queue)) { | 2938 if (!skb_queue_empty(&tp->out_of_order_queue)) { |
2939 tcp_ofo_queue(sk); 2940 2941 /* RFC2581. 4.2. SHOULD send immediate ACK, when 2942 * gap in queue is filled. 2943 */ | 2939 tcp_ofo_queue(sk); 2940 2941 /* RFC2581. 4.2. SHOULD send immediate ACK, when 2942 * gap in queue is filled. 2943 */ |
2944 if (!skb_queue_len(&tp->out_of_order_queue)) | 2944 if (skb_queue_empty(&tp->out_of_order_queue)) |
2945 tp->ack.pingpong = 0; 2946 } 2947 2948 if (tp->rx_opt.num_sacks) 2949 tcp_sack_remove(tp); 2950 2951 tcp_fast_path_check(sk, tp); 2952 --- 291 unchanged lines hidden (view full) --- 3244 3245 if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf) 3246 return 0; 3247 3248 /* Collapsing did not help, destructive actions follow. 3249 * This must not ever occur. */ 3250 3251 /* First, purge the out_of_order queue. */ | 2945 tp->ack.pingpong = 0; 2946 } 2947 2948 if (tp->rx_opt.num_sacks) 2949 tcp_sack_remove(tp); 2950 2951 tcp_fast_path_check(sk, tp); 2952 --- 291 unchanged lines hidden (view full) --- 3244 3245 if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf) 3246 return 0; 3247 3248 /* Collapsing did not help, destructive actions follow. 3249 * This must not ever occur. */ 3250 3251 /* First, purge the out_of_order queue. */ |
3252 if (skb_queue_len(&tp->out_of_order_queue)) { 3253 NET_ADD_STATS_BH(LINUX_MIB_OFOPRUNED, 3254 skb_queue_len(&tp->out_of_order_queue)); | 3252 if (!skb_queue_empty(&tp->out_of_order_queue)) { 3253 NET_INC_STATS_BH(LINUX_MIB_OFOPRUNED); |
3255 __skb_queue_purge(&tp->out_of_order_queue); 3256 3257 /* Reset SACK state. A conforming SACK implementation will 3258 * do the same at a timeout based retransmit. When a connection 3259 * is in a sad state like this, we care only about integrity 3260 * of the connection not performance. 3261 */ 3262 if (tp->rx_opt.sack_ok) --- 1054 unchanged lines hidden --- | 3254 __skb_queue_purge(&tp->out_of_order_queue); 3255 3256 /* Reset SACK state. A conforming SACK implementation will 3257 * do the same at a timeout based retransmit. When a connection 3258 * is in a sad state like this, we care only about integrity 3259 * of the connection not performance. 3260 */ 3261 if (tp->rx_opt.sack_ok) --- 1054 unchanged lines hidden --- |