Lines Matching defs:tb2
98 const struct inet_bind2_bucket *tb2;
108 hlist_for_each_entry(tb2, &tb->bhash2, bhash_node) {
109 if (tb2->fastreuse != -1 || tb2->fastreuseport != -1)
123 static void inet_bind2_bucket_init(struct inet_bind2_bucket *tb2,
129 write_pnet(&tb2->ib_net, net);
130 tb2->l3mdev = tb->l3mdev;
131 tb2->port = tb->port;
135 tb2->addr_type = ipv6_addr_type(&sk->sk_v6_rcv_saddr);
136 tb2->v6_rcv_saddr = sk->sk_v6_rcv_saddr;
138 tb2->addr_type = IPV6_ADDR_MAPPED;
139 ipv6_addr_set_v4mapped(sk->sk_rcv_saddr, &tb2->v6_rcv_saddr);
142 tb2->rcv_saddr = sk->sk_rcv_saddr;
144 tb2->fastreuse = 0;
145 tb2->fastreuseport = 0;
146 INIT_HLIST_HEAD(&tb2->owners);
147 hlist_add_head(&tb2->node, &head->chain);
148 hlist_add_head(&tb2->bhash_node, &tb->bhash2);
157 struct inet_bind2_bucket *tb2 = kmem_cache_alloc(cachep, GFP_ATOMIC);
159 if (tb2)
160 inet_bind2_bucket_init(tb2, net, head, tb, sk);
162 return tb2;
187 static bool inet_bind2_bucket_addr_match(const struct inet_bind2_bucket *tb2,
192 return ipv6_addr_equal(&tb2->v6_rcv_saddr, &sk->sk_v6_rcv_saddr);
194 if (tb2->addr_type != IPV6_ADDR_MAPPED)
197 return tb2->rcv_saddr == sk->sk_rcv_saddr;
201 struct inet_bind2_bucket *tb2, unsigned short port)
205 inet_csk(sk)->icsk_bind2_hash = tb2;
206 sk_add_bind_node(sk, &tb2->owners);
232 struct inet_bind2_bucket *tb2 = inet_csk(sk)->icsk_bind2_hash;
236 inet_bind2_bucket_destroy(hashinfo->bind2_bucket_cachep, tb2);
260 struct inet_bind2_bucket *tb2;
271 tb2 = inet_csk(sk)->icsk_bind2_hash;
272 if (unlikely(!tb || !tb2)) {
302 } else if (!inet_bind2_bucket_addr_match(tb2, child)) {
306 tb2 = inet_bind2_bucket_find(head2, net, port, l3mdev, child);
307 if (!tb2) {
308 tb2 = inet_bind2_bucket_create(table->bind2_bucket_cachep,
310 if (!tb2)
315 inet_csk_update_fastreuse(child, tb, tb2);
316 inet_bind_hash(child, tb, tb2, port);
927 struct inet_bind2_bucket *tb2, *new_tb2;
944 * the bhash2 table in an inconsistent state if a new tb2 bucket
984 tb2 = inet_bind2_bucket_find(head2, net, port, l3mdev, sk);
985 if (!tb2) {
986 tb2 = new_tb2;
987 inet_bind2_bucket_init(tb2, net, head2, inet_csk(sk)->icsk_bind_hash, sk);
989 tb2->fastreuse = -1;
990 tb2->fastreuseport = -1;
993 inet_csk(sk)->icsk_bind2_hash = tb2;
994 sk_add_bind_node(sk, &tb2->owners);
999 if (tb2 != new_tb2)
1043 struct inet_bind2_bucket *tb2;
1150 /* Find the corresponding tb2 bucket since we need to
1156 tb2 = inet_bind2_bucket_find(head2, net, port, l3mdev, sk);
1157 if (!tb2) {
1158 tb2 = inet_bind2_bucket_create(hinfo->bind2_bucket_cachep, net,
1160 if (!tb2)
1162 tb2->fastreuse = -1;
1163 tb2->fastreuseport = -1;
1175 inet_bind_hash(sk, tb, tb2, port);