inet_listen_lock(&tcp_hashinfo); 
 inet_listen_lock(hashinfo); 
static int tcpdiag_dump(struct sk_buff *skb, struct netlink_callback *cb){	int i, num;	int s_i, s_num;	struct tcpdiagreq *r = NLMSG_DATA(cb->nlh);	s_i = cb->args[1];	s_num = num = cb->args[2];	if (cb->args[0] == 0) {		if (!(r->tcpdiag_states&(TCPF_LISTEN|TCPF_SYN_RECV)))			goto skip_listen_ht;		inet_listen_lock(&tcp_hashinfo);		for (i = s_i; i < INET_LHTABLE_SIZE; i++) {			struct sock *sk;			struct hlist_node *node;			num = 0;			sk_for_each(sk, node, &tcp_hashinfo.listening_hash[i]) {				struct inet_sock *inet = inet_sk(sk);				if (num < s_num) {					num++;					continue;				}				if (r->id.tcpdiag_sport != inet->sport &&				    r->id.tcpdiag_sport)					goto next_listen;				if (!(r->tcpdiag_states&TCPF_LISTEN) ||				    r->id.tcpdiag_dport ||				    cb->args[3] > 0)					goto syn_recv;				if (tcpdiag_dump_sock(skb, sk, cb) < 0) {					inet_listen_unlock(&tcp_hashinfo);					goto done;				}syn_recv:				if (!(r->tcpdiag_states&TCPF_SYN_RECV))					goto next_listen;				if (tcpdiag_dump_reqs(skb, sk, cb) < 0) {					inet_listen_unlock(&tcp_hashinfo);					goto done;				}next_listen:				cb->args[3] = 0;				cb->args[4] = 0;				++num;			}			s_num = 0;			cb->args[3] = 0;			cb->args[4] = 0;		}		inet_listen_unlock(&tcp_hashinfo);skip_listen_ht:		cb->args[0] = 1;		s_i = num = s_num = 0;	}	if (!(r->tcpdiag_states&~(TCPF_LISTEN|TCPF_SYN_RECV)))		return skb->len;	for (i = s_i; i < tcp_hashinfo.ehash_size; i++) {		struct inet_ehash_bucket *head = &tcp_hashinfo.ehash[i];		struct sock *sk;		struct hlist_node *node;		if (i > s_i)			s_num = 0;		read_lock_bh(&head->lock);		num = 0;		sk_for_each(sk, node, &head->chain) {			struct inet_sock *inet = inet_sk(sk);			if (num < s_num)				goto next_normal;			if (!(r->tcpdiag_states & (1 << sk->sk_state)))				goto next_normal;			if (r->id.tcpdiag_sport != inet->sport &&			    r->id.tcpdiag_sport)				goto next_normal;			if (r->id.tcpdiag_dport != inet->dport && r->id.tcpdiag_dport)				goto next_normal;			if (tcpdiag_dump_sock(skb, sk, cb) < 0) {				read_unlock_bh(&head->lock);				goto done;			}next_normal:			++num;		}		if (r->tcpdiag_states&TCPF_TIME_WAIT) {			sk_for_each(sk, node,				    &tcp_hashinfo.ehash[i + tcp_hashinfo.ehash_size].chain) {				struct inet_sock *inet = inet_sk(sk);				if (num < s_num)					goto next_dying;				if (r->id.tcpdiag_sport != inet->sport &&				    r->id.tcpdiag_sport)					goto next_dying;				if (r->id.tcpdiag_dport != inet->dport &&				    r->id.tcpdiag_dport)					goto next_dying;				if (tcpdiag_dump_sock(skb, sk, cb) < 0) {					read_unlock_bh(&head->lock);					goto done;				}next_dying:				++num;			}		}		read_unlock_bh(&head->lock);	}done:	cb->args[1] = i;	cb->args[2] = num;	return skb->len;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/540722ffc3a0d7e11d97a13e1ce6f3bc23b061c1/tcp_diag.c/buggy/net/ipv4/tcp_diag.c