* is sent until it is ACKed. In normal curcumstances sending small 
* is sent until it is ACKed. In normal circumstances sending small 
static void tcp_init_metrics(struct sock *sk){	struct tcp_sock *tp = tcp_sk(sk);	struct dst_entry *dst = __sk_dst_get(sk);	if (dst == NULL)		goto reset;	dst_confirm(dst);	if (dst_metric_locked(dst, RTAX_CWND))		tp->snd_cwnd_clamp = dst_metric(dst, RTAX_CWND);	if (dst_metric(dst, RTAX_SSTHRESH)) {		tp->snd_ssthresh = dst_metric(dst, RTAX_SSTHRESH);		if (tp->snd_ssthresh > tp->snd_cwnd_clamp)			tp->snd_ssthresh = tp->snd_cwnd_clamp;	}	if (dst_metric(dst, RTAX_REORDERING) &&	    tp->reordering != dst_metric(dst, RTAX_REORDERING)) {		tp->rx_opt.sack_ok &= ~2;		tp->reordering = dst_metric(dst, RTAX_REORDERING);	}	if (dst_metric(dst, RTAX_RTT) == 0)		goto reset;	if (!tp->srtt && dst_metric(dst, RTAX_RTT) < (TCP_TIMEOUT_INIT << 3))		goto reset;	/* Initial rtt is determined from SYN,SYN-ACK.	 * The segment is small and rtt may appear much	 * less than real one. Use per-dst memory	 * to make it more realistic.	 *	 * A bit of theory. RTT is time passed after "normal" sized packet	 * is sent until it is ACKed. In normal curcumstances sending small	 * packets force peer to delay ACKs and calculation is correct too.	 * The algorithm is adaptive and, provided we follow specs, it	 * NEVER underestimate RTT. BUT! If peer tries to make some clever	 * tricks sort of "quick acks" for time long enough to decrease RTT	 * to low value, and then abruptly stops to do it and starts to delay	 * ACKs, wait for troubles.	 */	if (dst_metric(dst, RTAX_RTT) > tp->srtt) {		tp->srtt = dst_metric(dst, RTAX_RTT);		tp->rtt_seq = tp->snd_nxt;	}	if (dst_metric(dst, RTAX_RTTVAR) > tp->mdev) {		tp->mdev = dst_metric(dst, RTAX_RTTVAR);		tp->mdev_max = tp->rttvar = max(tp->mdev, TCP_RTO_MIN);	}	tcp_set_rto(sk);	tcp_bound_rto(sk);	if (inet_csk(sk)->icsk_rto < TCP_TIMEOUT_INIT && !tp->rx_opt.saw_tstamp)		goto reset;	tp->snd_cwnd = tcp_init_cwnd(tp, dst);	tp->snd_cwnd_stamp = tcp_time_stamp;	return;reset:	/* Play conservative. If timestamps are not	 * supported, TCP will fail to recalculate correct	 * rtt, if initial rto is too small. FORGET ALL AND RESET!	 */	if (!tp->rx_opt.saw_tstamp && tp->srtt) {		tp->srtt = 0;		tp->mdev = tp->mdev_max = tp->rttvar = TCP_TIMEOUT_INIT;		inet_csk(sk)->icsk_rto = TCP_TIMEOUT_INIT;	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/caa20d9abe810be2ede9612b6c9db6ce7d6edf80/tcp_input.c/buggy/net/ipv4/tcp_input.c