Lines Matching refs:snum
235 * @snum: port number to look up
239 int udp_lib_get_port(struct sock *sk, unsigned short snum,
247 if (!snum) {
267 udp_lib_lport_inuse(net, snum, hslot, bitmap, sk,
270 snum = first;
272 * Iterate on all possible values of snum for this hash.
277 if (low <= snum && snum <= high &&
278 !test_bit(snum >> udptable->log, bitmap) &&
279 !inet_is_local_reserved_port(net, snum))
281 snum += rand;
282 } while (snum != first);
288 hslot = udp_hashslot(udptable, net, snum);
292 unsigned int slot2 = udp_sk(sk)->udp_portaddr_hash ^ snum;
301 exist = udp_lib_lport_inuse2(net, snum, hslot2, sk);
304 exist = udp_lib_lport_inuse2(net, snum, hslot2,
313 if (udp_lib_lport_inuse(net, snum, hslot, NULL, sk, 0))
317 inet_sk(sk)->inet_num = snum;
318 udp_sk(sk)->udp_port_hash = snum;
319 udp_sk(sk)->udp_portaddr_hash ^= snum;
325 udp_sk(sk)->udp_portaddr_hash ^= snum;
354 int udp_v4_get_port(struct sock *sk, unsigned short snum)
357 ipv4_portaddr_hash(sock_net(sk), htonl(INADDR_ANY), snum);
363 return udp_lib_get_port(sk, snum, hash2_nulladdr);