Lines Matching refs:tb

241 /* This should be called only when the tb and tb2 hashbuckets' locks are held */
243 const struct inet_bind_bucket *tb,
269 * in tb->owners and tb2->owners list belong
272 sk_for_each_bound_bhash(sk2, tb2, tb) {
340 struct inet_bind_bucket *tb;
388 inet_bind_bucket_for_each(tb, &head->chain)
389 if (inet_bind_bucket_match(tb, net, port, l3mdev)) {
390 if (!inet_csk_bind_conflict(sk, tb, tb2,
396 tb = NULL;
421 *tb_ret = tb;
427 static inline int sk_reuseport_match(struct inet_bind_bucket *tb,
432 if (tb->fastreuseport <= 0)
438 if (!uid_eq(tb->fastuid, uid))
440 /* We only need to check the rcv_saddr if this tb was once marked
445 if (tb->fastreuseport == FASTREUSEPORT_ANY)
448 if (tb->fast_sk_family == AF_INET6)
449 return ipv6_rcv_saddr_equal(&tb->fast_v6_rcv_saddr,
451 tb->fast_rcv_saddr,
453 tb->fast_ipv6_only,
456 return ipv4_rcv_saddr_equal(tb->fast_rcv_saddr, sk->sk_rcv_saddr,
460 void inet_csk_update_fastreuse(struct inet_bind_bucket *tb,
466 if (hlist_empty(&tb->bhash2)) {
467 tb->fastreuse = reuse;
469 tb->fastreuseport = FASTREUSEPORT_ANY;
470 tb->fastuid = uid;
471 tb->fast_rcv_saddr = sk->sk_rcv_saddr;
472 tb->fast_ipv6_only = ipv6_only_sock(sk);
473 tb->fast_sk_family = sk->sk_family;
475 tb->fast_v6_rcv_saddr = sk->sk_v6_rcv_saddr;
478 tb->fastreuseport = 0;
482 tb->fastreuse = 0;
485 * the tb, but we have sk_reuseport set on this socket
487 * this socket in this tb, so reset our tb's reuseport
495 if (!sk_reuseport_match(tb, sk)) {
496 tb->fastreuseport = FASTREUSEPORT_STRICT;
497 tb->fastuid = uid;
498 tb->fast_rcv_saddr = sk->sk_rcv_saddr;
499 tb->fast_ipv6_only = ipv6_only_sock(sk);
500 tb->fast_sk_family = sk->sk_family;
502 tb->fast_v6_rcv_saddr = sk->sk_v6_rcv_saddr;
506 tb->fastreuseport = 0;
524 struct inet_bind_bucket *tb = NULL;
531 head = inet_csk_find_open_port(sk, &tb, &tb2, &head2, &port);
537 if (tb && tb2)
544 inet_bind_bucket_for_each(tb, &head->chain)
545 if (inet_bind_bucket_match(tb, net, port, l3mdev))
549 if (!tb) {
550 tb = inet_bind_bucket_create(hinfo->bind_bucket_cachep, net,
552 if (!tb)
558 if (!hlist_empty(&tb->bhash2)) {
560 (tb->fastreuse > 0 && reuse) ||
561 sk_reuseport_match(tb, sk))
578 net, head2, tb, sk);
585 if (inet_csk_bind_conflict(sk, tb, tb2, true, true))
590 inet_csk_update_fastreuse(tb, sk);
593 inet_bind_hash(sk, tb, tb2, port);
594 WARN_ON(inet_csk(sk)->icsk_bind_hash != tb);
603 inet_bind_bucket_destroy(hinfo->bind_bucket_cachep, tb);