Lines Matching refs:port
282 * against concurrent binds on the port for addr any
284 static bool inet_bhash2_addr_any_conflict(const struct sock *sk, int port, int l3mdev,
300 head2 = inet_bhash2_addr_any_hashbucket(sk, net, port);
305 if (inet_bind2_bucket_match_addr_any(tb2, net, port, l3mdev, sk))
319 * Find an open port number for the socket. Returns with the
328 int i, low, high, attempt_half, port, l3mdev;
363 port = low + offset;
364 for (i = 0; i < remaining; i += 2, port += 2) {
365 if (unlikely(port >= high))
366 port -= remaining;
367 if (inet_is_local_reserved_port(net, port))
369 head = &hinfo->bhash[inet_bhashfn(net, port,
373 if (inet_bhash2_addr_any_conflict(sk, port, l3mdev, relax, false))
377 head2 = inet_bhashfn_portaddr(hinfo, sk, net, port);
379 tb2 = inet_bind2_bucket_find(head2, net, port, l3mdev, sk);
381 if (inet_bind_bucket_match(tb, net, port, l3mdev)) {
412 *port_ret = port;
503 /* Obtain a reference to a local port for the given sock,
504 * if snum is zero it means select any available local port.
505 * We try to allocate an odd port (and leave even ports for connect())
513 int ret = -EADDRINUSE, port = snum, l3mdev;
522 if (!port) {
523 head = inet_csk_find_open_port(sk, &tb, &tb2, &head2, &port);
533 head = &hinfo->bhash[inet_bhashfn(net, port,
537 if (inet_bind_bucket_match(tb, net, port, l3mdev))
543 head, port, l3mdev);
558 if (inet_bhash2_addr_any_conflict(sk, port, l3mdev, true, true))
562 head2 = inet_bhashfn_portaddr(hinfo, sk, net, port);
565 tb2 = inet_bind2_bucket_find(head2, net, port, l3mdev, sk);
570 net, head2, port, l3mdev, sk);
585 inet_bind_hash(sk, tb, tb2, port);