/* Advanve CWND, if state allows this. */ 
/* Advance CWND, if state allows this. */ 
static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag){	struct inet_connection_sock *icsk = inet_csk(sk);	struct tcp_sock *tp = tcp_sk(sk);	u32 prior_snd_una = tp->snd_una;	u32 ack_seq = TCP_SKB_CB(skb)->seq;	u32 ack = TCP_SKB_CB(skb)->ack_seq;	u32 prior_in_flight;	s32 seq_rtt;	int prior_packets;	/* If the ack is newer than sent or older than previous acks	 * then we can probably ignore it.	 */	if (after(ack, tp->snd_nxt))		goto uninteresting_ack;	if (before(ack, prior_snd_una))		goto old_ack;	if (sysctl_tcp_abc && icsk->icsk_ca_state < TCP_CA_CWR)		tp->bytes_acked += ack - prior_snd_una;	if (!(flag&FLAG_SLOWPATH) && after(ack, prior_snd_una)) {		/* Window is constant, pure forward advance.		 * No more checks are required.		 * Note, we use the fact that SND.UNA>=SND.WL2.		 */		tcp_update_wl(tp, ack, ack_seq);		tp->snd_una = ack;		flag |= FLAG_WIN_UPDATE;		tcp_ca_event(sk, CA_EVENT_FAST_ACK);		NET_INC_STATS_BH(LINUX_MIB_TCPHPACKS);	} else {		if (ack_seq != TCP_SKB_CB(skb)->end_seq)			flag |= FLAG_DATA;		else			NET_INC_STATS_BH(LINUX_MIB_TCPPUREACKS);		flag |= tcp_ack_update_window(sk, tp, skb, ack, ack_seq);		if (TCP_SKB_CB(skb)->sacked)			flag |= tcp_sacktag_write_queue(sk, skb, prior_snd_una);		if (TCP_ECN_rcv_ecn_echo(tp, skb->h.th))			flag |= FLAG_ECE;		tcp_ca_event(sk, CA_EVENT_SLOW_ACK);	}	/* We passed data and got it acked, remove any soft error	 * log. Something worked...	 */	sk->sk_err_soft = 0;	tp->rcv_tstamp = tcp_time_stamp;	prior_packets = tp->packets_out;	if (!prior_packets)		goto no_queue;	prior_in_flight = tcp_packets_in_flight(tp);	/* See if we can take anything off of the retransmit queue. */	flag |= tcp_clean_rtx_queue(sk, &seq_rtt);	if (tp->frto_counter)		tcp_process_frto(sk, prior_snd_una);	if (tcp_ack_is_dubious(sk, flag)) {		/* Advanve CWND, if state allows this. */		if ((flag & FLAG_DATA_ACKED) && tcp_may_raise_cwnd(sk, flag))			tcp_cong_avoid(sk, ack,  seq_rtt, prior_in_flight, 0);		tcp_fastretrans_alert(sk, prior_snd_una, prior_packets, flag);	} else {		if ((flag & FLAG_DATA_ACKED))			tcp_cong_avoid(sk, ack, seq_rtt, prior_in_flight, 1);	}	if ((flag & FLAG_FORWARD_PROGRESS) || !(flag&FLAG_NOT_DUP))		dst_confirm(sk->sk_dst_cache);	return 1;no_queue:	icsk->icsk_probes_out = 0;	/* If this ack opens up a zero window, clear backoff.  It was	 * being used to time the probes, and is probably far higher than	 * it needs to be for normal retransmission.	 */	if (sk->sk_send_head)		tcp_ack_probe(sk);	return 1;old_ack:	if (TCP_SKB_CB(skb)->sacked)		tcp_sacktag_write_queue(sk, skb, prior_snd_una);uninteresting_ack:	SOCK_DEBUG(sk, "Ack %u out of %u:%u\n", ack, tp->snd_una, tp->snd_nxt);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/caa20d9abe810be2ede9612b6c9db6ce7d6edf80/tcp_input.c/buggy/net/ipv4/tcp_input.c