spin_lock(&hashinfo->portalloc_lock); if (hashinfo->port_rover < low) rover = low; else rover = hashinfo->port_rover; 
int inet_csk_get_port(struct inet_hashinfo *hashinfo,		      struct sock *sk, unsigned short snum){	struct inet_bind_hashbucket *head;	struct hlist_node *node;	struct inet_bind_bucket *tb;	int ret;	local_bh_disable();	if (!snum) {		int low = sysctl_local_port_range[0];		int high = sysctl_local_port_range[1];		int remaining = (high - low) + 1;		int rover;		spin_lock(&hashinfo->portalloc_lock);		if (hashinfo->port_rover < low)			rover = low;		else			rover = hashinfo->port_rover;		do {			rover++;			if (rover > high)				rover = low;			head = &hashinfo->bhash[inet_bhashfn(rover, hashinfo->bhash_size)];			spin_lock(&head->lock);			inet_bind_bucket_for_each(tb, node, &head->chain)				if (tb->port == rover)					goto next;			break;		next:			spin_unlock(&head->lock);		} while (--remaining > 0);		hashinfo->port_rover = rover;		spin_unlock(&hashinfo->portalloc_lock);		/* Exhausted local port range during search?  It is not		 * possible for us to be holding one of the bind hash		 * locks if this test triggers, because if 'remaining'		 * drops to zero, we broke out of the do/while loop at		 * the top level, not from the 'break;' statement.		 */		ret = 1;		if (remaining <= 0)			goto fail;		/* OK, here is the one we will use.  HEAD is		 * non-NULL and we hold it's mutex.		 */		snum = rover;	} else {		head = &hashinfo->bhash[inet_bhashfn(snum, hashinfo->bhash_size)];		spin_lock(&head->lock);		inet_bind_bucket_for_each(tb, node, &head->chain)			if (tb->port == snum)				goto tb_found;	}	tb = NULL;	goto tb_not_found;tb_found:	if (!hlist_empty(&tb->owners)) {		if (sk->sk_reuse > 1)			goto success;		if (tb->fastreuse > 0 &&		    sk->sk_reuse && sk->sk_state != TCP_LISTEN) {			goto success;		} else {			ret = 1;			if (inet_csk_bind_conflict(sk, tb))				goto fail_unlock;		}	}tb_not_found:	ret = 1;	if (!tb && (tb = inet_bind_bucket_create(hashinfo->bind_bucket_cachep, head, snum)) == NULL)		goto fail_unlock;	if (hlist_empty(&tb->owners)) {		if (sk->sk_reuse && sk->sk_state != TCP_LISTEN)			tb->fastreuse = 1;		else			tb->fastreuse = 0;	} else if (tb->fastreuse &&		   (!sk->sk_reuse || sk->sk_state == TCP_LISTEN))		tb->fastreuse = 0;success:	if (!inet_csk(sk)->icsk_bind_hash)		inet_bind_hash(sk, tb, snum);	BUG_TRAP(inet_csk(sk)->icsk_bind_hash == tb); 	ret = 0;fail_unlock:	spin_unlock(&head->lock);fail:	local_bh_enable();	return ret;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/6df716340da3a6fdd33d73d7ed4c6f7590ca1c42/inet_connection_sock.c/buggy/net/ipv4/inet_connection_sock.c