ck_established)(struct inet_timewait_death_row *, 04. struct sock *, __u16, struct inet_timewait_sock **), 05. void (*hash)(struct sock *sk)) 06.{ 07. struct inet_hashinfo *hinfo = death_row->hashinfo; 08. const unsigned short snum = inet_sk(sk)->num; 09. struct inet_bind_hashbucket *head; 10. struct inet_bind_bucket *tb; 11. int ret; 12. struct net *net = sock_net(sk); 13. 14. if (!snum) { 15. ...... 16. } 17. 18. head = &hinfo->bhash[inet_bhashfn(net, snum, hinfo->bhash_size)]; 19. tb = inet_csk(sk)->icsk_bind_hash; 20. spin_lock_bh(&head->lock); 21. if (sk_head(&tb->owners) == sk && !sk->sk_bind_node.next) { 22. hash(sk); 23. spin_unlock_bh(&head->lock); 24. return 0; 25. } else { 26. spin_unlock(&head->lock); 27. /* No definite answer... Walk to established hash table */ 28. ret = check_established(death_row, sk, snum, NULL); 29.out: 30. local_bh_enable(); 31. return ret; 32. } 33.} int __inet_hash_connect(struct inet_timewait_death_row *death_row, struct sock *sk, u32 port_offset, int (*check_established)(struct inet_timewait_death_row *, struct sock *, __u16, struct inet_timewait_sock **), void (*hash)(struct sock *sk)) { struct inet_hashinfo *hinfo = death_row->hashinfo; const unsigned short snum = inet_sk(sk)->num; struct inet_bind_hashbucket *head; struct inet_bind_bucket *tb; int ret; struct net *net = sock_net(sk);
if (!snum) { ...... }
head = &hinfo->bhash[inet_bhashfn(net, snum, hinfo->bhash_size)];
<< 上一页 [11] [12] [13] [14] [15] 下一页
|