Lines Matching refs:snum
231 int udp_lib_get_port(struct sock *sk, unsigned short snum, in udp_lib_get_port() argument
239 if (!snum) { in udp_lib_get_port()
259 udp_lib_lport_inuse(net, snum, hslot, bitmap, sk, in udp_lib_get_port()
262 snum = first; in udp_lib_get_port()
269 if (low <= snum && snum <= high && in udp_lib_get_port()
270 !test_bit(snum >> udptable->log, bitmap) && in udp_lib_get_port()
271 !inet_is_local_reserved_port(net, snum)) in udp_lib_get_port()
273 snum += rand; in udp_lib_get_port()
274 } while (snum != first); in udp_lib_get_port()
280 hslot = udp_hashslot(udptable, net, snum); in udp_lib_get_port()
284 unsigned int slot2 = udp_sk(sk)->udp_portaddr_hash ^ snum; in udp_lib_get_port()
293 exist = udp_lib_lport_inuse2(net, snum, hslot2, sk); in udp_lib_get_port()
296 exist = udp_lib_lport_inuse2(net, snum, hslot2, in udp_lib_get_port()
305 if (udp_lib_lport_inuse(net, snum, hslot, NULL, sk, 0)) in udp_lib_get_port()
309 inet_sk(sk)->inet_num = snum; in udp_lib_get_port()
310 udp_sk(sk)->udp_port_hash = snum; in udp_lib_get_port()
311 udp_sk(sk)->udp_portaddr_hash ^= snum; in udp_lib_get_port()
317 udp_sk(sk)->udp_portaddr_hash ^= snum; in udp_lib_get_port()
346 int udp_v4_get_port(struct sock *sk, unsigned short snum) in udp_v4_get_port() argument
349 ipv4_portaddr_hash(sock_net(sk), htonl(INADDR_ANY), snum); in udp_v4_get_port()
355 return udp_lib_get_port(sk, snum, hash2_nulladdr); in udp_v4_get_port()