Lines Matching refs:snum
226 * @snum: port number to look up
230 int udp_lib_get_port(struct sock *sk, unsigned short snum,
238 if (!snum) {
258 udp_lib_lport_inuse(net, snum, hslot, bitmap, sk,
261 snum = first;
263 * Iterate on all possible values of snum for this hash.
268 if (low <= snum && snum <= high &&
269 !test_bit(snum >> udptable->log, bitmap) &&
270 !inet_is_local_reserved_port(net, snum))
272 snum += rand;
273 } while (snum != first);
279 hslot = udp_hashslot(udptable, net, snum);
283 unsigned int slot2 = udp_sk(sk)->udp_portaddr_hash ^ snum;
292 exist = udp_lib_lport_inuse2(net, snum, hslot2, sk);
295 exist = udp_lib_lport_inuse2(net, snum, hslot2,
304 if (udp_lib_lport_inuse(net, snum, hslot, NULL, sk, 0))
308 inet_sk(sk)->inet_num = snum;
309 udp_sk(sk)->udp_port_hash = snum;
310 udp_sk(sk)->udp_portaddr_hash ^= snum;
316 udp_sk(sk)->udp_portaddr_hash ^= snum;
347 int udp_v4_get_port(struct sock *sk, unsigned short snum)
350 ipv4_portaddr_hash(sock_net(sk), htonl(INADDR_ANY), snum);
356 return udp_lib_get_port(sk, snum, hash2_nulladdr);