const int hash = inet_ehashfn(daddr, lport, saddr, inet->dport, tcp_hashinfo.ehash_size); struct inet_ehash_bucket *head = &tcp_hashinfo.ehash[hash]; 
unsigned int hash = inet_ehashfn(daddr, lport, saddr, inet->dport); struct inet_ehash_bucket *head = inet_ehash_bucket(&tcp_hashinfo, hash); 
static int __tcp_v4_check_established(struct sock *sk, __u16 lport,				      struct inet_timewait_sock **twp){	struct inet_sock *inet = inet_sk(sk);	u32 daddr = inet->rcv_saddr;	u32 saddr = inet->daddr;	int dif = sk->sk_bound_dev_if;	INET_ADDR_COOKIE(acookie, saddr, daddr)	const __u32 ports = INET_COMBINED_PORTS(inet->dport, lport);	const int hash = inet_ehashfn(daddr, lport, saddr, inet->dport, tcp_hashinfo.ehash_size);	struct inet_ehash_bucket *head = &tcp_hashinfo.ehash[hash];	struct sock *sk2;	const struct hlist_node *node;	struct inet_timewait_sock *tw;	write_lock(&head->lock);	/* Check TIME-WAIT sockets first. */	sk_for_each(sk2, node, &(head + tcp_hashinfo.ehash_size)->chain) {		tw = inet_twsk(sk2);		if (INET_TW_MATCH(sk2, acookie, saddr, daddr, ports, dif)) {			const struct tcp_timewait_sock *tcptw = tcp_twsk(sk2);			struct tcp_sock *tp = tcp_sk(sk);			/* With PAWS, it is safe from the viewpoint			   of data integrity. Even without PAWS it			   is safe provided sequence spaces do not			   overlap i.e. at data rates <= 80Mbit/sec.			   Actually, the idea is close to VJ's one,			   only timestamp cache is held not per host,			   but per port pair and TW bucket is used			   as state holder.			   If TW bucket has been already destroyed we			   fall back to VJ's scheme and use initial			   timestamp retrieved from peer table.			 */			if (tcptw->tw_ts_recent_stamp &&			    (!twp || (sysctl_tcp_tw_reuse &&				      xtime.tv_sec -				      tcptw->tw_ts_recent_stamp > 1))) {				tp->write_seq = tcptw->tw_snd_nxt + 65535 + 2;				if (tp->write_seq == 0)					tp->write_seq = 1;				tp->rx_opt.ts_recent	   = tcptw->tw_ts_recent;				tp->rx_opt.ts_recent_stamp = tcptw->tw_ts_recent_stamp;				sock_hold(sk2);				goto unique;			} else				goto not_unique;		}	}	tw = NULL;	/* And established part... */	sk_for_each(sk2, node, &head->chain) {		if (INET_MATCH(sk2, acookie, saddr, daddr, ports, dif))			goto not_unique;	}unique:	/* Must record num and sport now. Otherwise we will see	 * in hash table socket with a funny identity. */	inet->num = lport;	inet->sport = htons(lport);	sk->sk_hashent = hash;	BUG_TRAP(sk_unhashed(sk));	__sk_add_node(sk, &head->chain);	sock_prot_inc_use(sk->sk_prot);	write_unlock(&head->lock);	if (twp) {		*twp = tw;		NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED);	} else if (tw) {		/* Silly. Should hash-dance instead... */		inet_twsk_deschedule(tw, &tcp_death_row);		NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED);		inet_twsk_put(tw);	}	return 0;not_unique:	write_unlock(&head->lock);	return -EADDRNOTAVAIL;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/81c3d5470ecc70564eb9209946730fe2be93ad06/tcp_ipv4.c/buggy/net/ipv4/tcp_ipv4.c