udp.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. /*
  2. * INET An implementation of the TCP/IP protocol suite for the LINUX
  3. * operating system. INET is implemented using the BSD Socket
  4. * interface as the means of communication with the user level.
  5. *
  6. * The User Datagram Protocol (UDP).
  7. *
  8. * Version: $Id: udp.c,v 1.102 2002/02/01 22:01:04 davem Exp $
  9. *
  10. * Authors: Ross Biro
  11. * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
  12. * Arnt Gulbrandsen, <agulbra@nvg.unit.no>
  13. * Alan Cox, <Alan.Cox@linux.org>
  14. * Hirokazu Takahashi, <taka@valinux.co.jp>
  15. *
  16. * Fixes:
  17. * Alan Cox : verify_area() calls
  18. * Alan Cox : stopped close while in use off icmp
  19. * messages. Not a fix but a botch that
  20. * for udp at least is 'valid'.
  21. * Alan Cox : Fixed icmp handling properly
  22. * Alan Cox : Correct error for oversized datagrams
  23. * Alan Cox : Tidied select() semantics.
  24. * Alan Cox : udp_err() fixed properly, also now
  25. * select and read wake correctly on errors
  26. * Alan Cox : udp_send verify_area moved to avoid mem leak
  27. * Alan Cox : UDP can count its memory
  28. * Alan Cox : send to an unknown connection causes
  29. * an ECONNREFUSED off the icmp, but
  30. * does NOT close.
  31. * Alan Cox : Switched to new sk_buff handlers. No more backlog!
  32. * Alan Cox : Using generic datagram code. Even smaller and the PEEK
  33. * bug no longer crashes it.
  34. * Fred Van Kempen : Net2e support for sk->broadcast.
  35. * Alan Cox : Uses skb_free_datagram
  36. * Alan Cox : Added get/set sockopt support.
  37. * Alan Cox : Broadcasting without option set returns EACCES.
  38. * Alan Cox : No wakeup calls. Instead we now use the callbacks.
  39. * Alan Cox : Use ip_tos and ip_ttl
  40. * Alan Cox : SNMP Mibs
  41. * Alan Cox : MSG_DONTROUTE, and 0.0.0.0 support.
  42. * Matt Dillon : UDP length checks.
  43. * Alan Cox : Smarter af_inet used properly.
  44. * Alan Cox : Use new kernel side addressing.
  45. * Alan Cox : Incorrect return on truncated datagram receive.
  46. * Arnt Gulbrandsen : New udp_send and stuff
  47. * Alan Cox : Cache last socket
  48. * Alan Cox : Route cache
  49. * Jon Peatfield : Minor efficiency fix to sendto().
  50. * Mike Shaver : RFC1122 checks.
  51. * Alan Cox : Nonblocking error fix.
  52. * Willy Konynenberg : Transparent proxying support.
  53. * Mike McLagan : Routing by source
  54. * David S. Miller : New socket lookup architecture.
  55. * Last socket cache retained as it
  56. * does have a high hit rate.
  57. * Olaf Kirch : Don't linearise iovec on sendmsg.
  58. * Andi Kleen : Some cleanups, cache destination entry
  59. * for connect.
  60. * Vitaly E. Lavrov : Transparent proxy revived after year coma.
  61. * Melvin Smith : Check msg_name not msg_namelen in sendto(),
  62. * return ENOTCONN for unconnected sockets (POSIX)
  63. * Janos Farkas : don't deliver multi/broadcasts to a different
  64. * bound-to-device socket
  65. * Hirokazu Takahashi : HW checksumming for outgoing UDP
  66. * datagrams.
  67. * Hirokazu Takahashi : sendfile() on UDP works now.
  68. * Arnaldo C. Melo : convert /proc/net/udp to seq_file
  69. * YOSHIFUJI Hideaki @USAGI and: Support IPV6_V6ONLY socket option, which
  70. * Alexey Kuznetsov: allow both IPv4 and IPv6 sockets to bind
  71. * a single port at the same time.
  72. * Derek Atkins <derek@ihtfp.com>: Add Encapulation Support
  73. * James Chapman : Add L2TP encapsulation type.
  74. *
  75. *
  76. * This program is free software; you can redistribute it and/or
  77. * modify it under the terms of the GNU General Public License
  78. * as published by the Free Software Foundation; either version
  79. * 2 of the License, or (at your option) any later version.
  80. */
  81. #include <asm/system.h>
  82. #include <asm/uaccess.h>
  83. #include <asm/ioctls.h>
  84. #include <linux/bootmem.h>
  85. #include <linux/types.h>
  86. #include <linux/fcntl.h>
  87. #include <linux/module.h>
  88. #include <linux/socket.h>
  89. #include <linux/sockios.h>
  90. #include <linux/igmp.h>
  91. #include <linux/in.h>
  92. #include <linux/errno.h>
  93. #include <linux/timer.h>
  94. #include <linux/mm.h>
  95. #include <linux/inet.h>
  96. #include <linux/netdevice.h>
  97. #include <net/tcp_states.h>
  98. #include <linux/skbuff.h>
  99. #include <linux/proc_fs.h>
  100. #include <linux/seq_file.h>
  101. #include <net/net_namespace.h>
  102. #include <net/icmp.h>
  103. #include <net/route.h>
  104. #include <net/checksum.h>
  105. #include <net/xfrm.h>
  106. #include "udp_impl.h"
  107. /*
  108. * Snmp MIB for the UDP layer
  109. */
  110. DEFINE_SNMP_STAT(struct udp_mib, udp_statistics) __read_mostly;
  111. EXPORT_SYMBOL(udp_statistics);
  112. DEFINE_SNMP_STAT(struct udp_mib, udp_stats_in6) __read_mostly;
  113. EXPORT_SYMBOL(udp_stats_in6);
  114. struct hlist_head udp_hash[UDP_HTABLE_SIZE];
  115. DEFINE_RWLOCK(udp_hash_lock);
  116. int sysctl_udp_mem[3] __read_mostly;
  117. int sysctl_udp_rmem_min __read_mostly;
  118. int sysctl_udp_wmem_min __read_mostly;
  119. EXPORT_SYMBOL(sysctl_udp_mem);
  120. EXPORT_SYMBOL(sysctl_udp_rmem_min);
  121. EXPORT_SYMBOL(sysctl_udp_wmem_min);
  122. atomic_t udp_memory_allocated;
  123. EXPORT_SYMBOL(udp_memory_allocated);
  124. static inline int __udp_lib_lport_inuse(struct net *net, __u16 num,
  125. const struct hlist_head udptable[])
  126. {
  127. struct sock *sk;
  128. struct hlist_node *node;
  129. sk_for_each(sk, node, &udptable[num & (UDP_HTABLE_SIZE - 1)])
  130. if (sk->sk_net == net && sk->sk_hash == num)
  131. return 1;
  132. return 0;
  133. }
  134. /**
  135. * __udp_lib_get_port - UDP/-Lite port lookup for IPv4 and IPv6
  136. *
  137. * @sk: socket struct in question
  138. * @snum: port number to look up
  139. * @udptable: hash list table, must be of UDP_HTABLE_SIZE
  140. * @saddr_comp: AF-dependent comparison of bound local IP addresses
  141. */
  142. int __udp_lib_get_port(struct sock *sk, unsigned short snum,
  143. struct hlist_head udptable[],
  144. int (*saddr_comp)(const struct sock *sk1,
  145. const struct sock *sk2 ) )
  146. {
  147. struct hlist_node *node;
  148. struct hlist_head *head;
  149. struct sock *sk2;
  150. int error = 1;
  151. struct net *net = sk->sk_net;
  152. write_lock_bh(&udp_hash_lock);
  153. if (!snum) {
  154. int i, low, high, remaining;
  155. unsigned rover, best, best_size_so_far;
  156. inet_get_local_port_range(&low, &high);
  157. remaining = (high - low) + 1;
  158. best_size_so_far = UINT_MAX;
  159. best = rover = net_random() % remaining + low;
  160. /* 1st pass: look for empty (or shortest) hash chain */
  161. for (i = 0; i < UDP_HTABLE_SIZE; i++) {
  162. int size = 0;
  163. head = &udptable[rover & (UDP_HTABLE_SIZE - 1)];
  164. if (hlist_empty(head))
  165. goto gotit;
  166. sk_for_each(sk2, node, head) {
  167. if (++size >= best_size_so_far)
  168. goto next;
  169. }
  170. best_size_so_far = size;
  171. best = rover;
  172. next:
  173. /* fold back if end of range */
  174. if (++rover > high)
  175. rover = low + ((rover - low)
  176. & (UDP_HTABLE_SIZE - 1));
  177. }
  178. /* 2nd pass: find hole in shortest hash chain */
  179. rover = best;
  180. for (i = 0; i < (1 << 16) / UDP_HTABLE_SIZE; i++) {
  181. if (! __udp_lib_lport_inuse(net, rover, udptable))
  182. goto gotit;
  183. rover += UDP_HTABLE_SIZE;
  184. if (rover > high)
  185. rover = low + ((rover - low)
  186. & (UDP_HTABLE_SIZE - 1));
  187. }
  188. /* All ports in use! */
  189. goto fail;
  190. gotit:
  191. snum = rover;
  192. } else {
  193. head = &udptable[snum & (UDP_HTABLE_SIZE - 1)];
  194. sk_for_each(sk2, node, head)
  195. if (sk2->sk_hash == snum &&
  196. sk2 != sk &&
  197. sk2->sk_net == net &&
  198. (!sk2->sk_reuse || !sk->sk_reuse) &&
  199. (!sk2->sk_bound_dev_if || !sk->sk_bound_dev_if
  200. || sk2->sk_bound_dev_if == sk->sk_bound_dev_if) &&
  201. (*saddr_comp)(sk, sk2) )
  202. goto fail;
  203. }
  204. inet_sk(sk)->num = snum;
  205. sk->sk_hash = snum;
  206. if (sk_unhashed(sk)) {
  207. head = &udptable[snum & (UDP_HTABLE_SIZE - 1)];
  208. sk_add_node(sk, head);
  209. sock_prot_inuse_add(sk->sk_prot, 1);
  210. }
  211. error = 0;
  212. fail:
  213. write_unlock_bh(&udp_hash_lock);
  214. return error;
  215. }
  216. int udp_get_port(struct sock *sk, unsigned short snum,
  217. int (*scmp)(const struct sock *, const struct sock *))
  218. {
  219. return __udp_lib_get_port(sk, snum, udp_hash, scmp);
  220. }
  221. /*
  222. * IOCTL requests applicable to the UDP protocol
  223. */
  224. int udp_ioctl(struct sock *sk, int cmd, unsigned long arg)
  225. {
  226. switch (cmd) {
  227. case SIOCOUTQ:
  228. {
  229. int amount = atomic_read(&sk->sk_wmem_alloc);
  230. return put_user(amount, (int __user *)arg);
  231. }
  232. case SIOCINQ:
  233. {
  234. struct sk_buff *skb;
  235. unsigned long amount;
  236. amount = 0;
  237. spin_lock_bh(&sk->sk_receive_queue.lock);
  238. skb = skb_peek(&sk->sk_receive_queue);
  239. if (skb != NULL) {
  240. /*
  241. * We will only return the amount
  242. * of this packet since that is all
  243. * that will be read.
  244. */
  245. amount = skb->len - sizeof(struct udphdr);
  246. }
  247. spin_unlock_bh(&sk->sk_receive_queue.lock);
  248. return put_user(amount, (int __user *)arg);
  249. }
  250. default:
  251. return -ENOIOCTLCMD;
  252. }
  253. return 0;
  254. }
  255. int udp_disconnect(struct sock *sk, int flags)
  256. {
  257. struct inet_sock *inet = inet_sk(sk);
  258. /*
  259. * 1003.1g - break association.
  260. */
  261. sk->sk_state = TCP_CLOSE;
  262. inet->daddr = 0;
  263. inet->dport = 0;
  264. sk->sk_bound_dev_if = 0;
  265. if (!(sk->sk_userlocks & SOCK_BINDADDR_LOCK))
  266. inet_reset_saddr(sk);
  267. if (!(sk->sk_userlocks & SOCK_BINDPORT_LOCK)) {
  268. sk->sk_prot->unhash(sk);
  269. inet->sport = 0;
  270. }
  271. sk_dst_reset(sk);
  272. return 0;
  273. }
  274. /*
  275. * Socket option code for UDP
  276. */
  277. int udp_lib_setsockopt(struct sock *sk, int level, int optname,
  278. char __user *optval, int optlen,
  279. int (*push_pending_frames)(struct sock *))
  280. {
  281. struct udp_sock *up = udp_sk(sk);
  282. int val;
  283. int err = 0;
  284. #ifdef CONFIG_IP_UDPLITE
  285. int is_udplite = IS_UDPLITE(sk);
  286. #endif
  287. if (optlen<sizeof(int))
  288. return -EINVAL;
  289. if (get_user(val, (int __user *)optval))
  290. return -EFAULT;
  291. switch (optname) {
  292. case UDP_CORK:
  293. if (val != 0) {
  294. up->corkflag = 1;
  295. } else {
  296. up->corkflag = 0;
  297. lock_sock(sk);
  298. (*push_pending_frames)(sk);
  299. release_sock(sk);
  300. }
  301. break;
  302. case UDP_ENCAP:
  303. switch (val) {
  304. case 0:
  305. case UDP_ENCAP_ESPINUDP:
  306. case UDP_ENCAP_ESPINUDP_NON_IKE:
  307. up->encap_rcv = xfrm4_udp_encap_rcv;
  308. /* FALLTHROUGH */
  309. case UDP_ENCAP_L2TPINUDP:
  310. up->encap_type = val;
  311. break;
  312. default:
  313. err = -ENOPROTOOPT;
  314. break;
  315. }
  316. break;
  317. #ifdef CONFIG_IP_UDPLITE
  318. /*
  319. * UDP-Lite's partial checksum coverage (RFC 3828).
  320. */
  321. /* The sender sets actual checksum coverage length via this option.
  322. * The case coverage > packet length is handled by send module. */
  323. case UDPLITE_SEND_CSCOV:
  324. if (!is_udplite) /* Disable the option on UDP sockets */
  325. return -ENOPROTOOPT;
  326. if (val != 0 && val < 8) /* Illegal coverage: use default (8) */
  327. val = 8;
  328. up->pcslen = val;
  329. up->pcflag |= UDPLITE_SEND_CC;
  330. break;
  331. /* The receiver specifies a minimum checksum coverage value. To make
  332. * sense, this should be set to at least 8 (as done below). If zero is
  333. * used, this again means full checksum coverage. */
  334. case UDPLITE_RECV_CSCOV:
  335. if (!is_udplite) /* Disable the option on UDP sockets */
  336. return -ENOPROTOOPT;
  337. if (val != 0 && val < 8) /* Avoid silly minimal values. */
  338. val = 8;
  339. up->pcrlen = val;
  340. up->pcflag |= UDPLITE_RECV_CC;
  341. break;
  342. #endif
  343. default:
  344. err = -ENOPROTOOPT;
  345. break;
  346. }
  347. return err;
  348. }
  349. int udp_lib_getsockopt(struct sock *sk, int level, int optname,
  350. char __user *optval, int __user *optlen)
  351. {
  352. struct udp_sock *up = udp_sk(sk);
  353. int val, len;
  354. if (get_user(len,optlen))
  355. return -EFAULT;
  356. len = min_t(unsigned int, len, sizeof(int));
  357. if (len < 0)
  358. return -EINVAL;
  359. switch (optname) {
  360. case UDP_CORK:
  361. val = up->corkflag;
  362. break;
  363. case UDP_ENCAP:
  364. val = up->encap_type;
  365. break;
  366. /* The following two cannot be changed on UDP sockets, the return is
  367. * always 0 (which corresponds to the full checksum coverage of UDP). */
  368. case UDPLITE_SEND_CSCOV:
  369. val = up->pcslen;
  370. break;
  371. case UDPLITE_RECV_CSCOV:
  372. val = up->pcrlen;
  373. break;
  374. default:
  375. return -ENOPROTOOPT;
  376. }
  377. if (put_user(len, optlen))
  378. return -EFAULT;
  379. if (copy_to_user(optval, &val,len))
  380. return -EFAULT;
  381. return 0;
  382. }
  383. /**
  384. * udp_poll - wait for a UDP event.
  385. * @file - file struct
  386. * @sock - socket
  387. * @wait - poll table
  388. *
  389. * This is same as datagram poll, except for the special case of
  390. * blocking sockets. If application is using a blocking fd
  391. * and a packet with checksum error is in the queue;
  392. * then it could get return from select indicating data available
  393. * but then block when reading it. Add special case code
  394. * to work around these arguably broken applications.
  395. */
  396. unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait)
  397. {
  398. unsigned int mask = datagram_poll(file, sock, wait);
  399. struct sock *sk = sock->sk;
  400. int is_lite = IS_UDPLITE(sk);
  401. /* Check for false positives due to checksum errors */
  402. if ( (mask & POLLRDNORM) &&
  403. !(file->f_flags & O_NONBLOCK) &&
  404. !(sk->sk_shutdown & RCV_SHUTDOWN)){
  405. struct sk_buff_head *rcvq = &sk->sk_receive_queue;
  406. struct sk_buff *skb;
  407. spin_lock_bh(&rcvq->lock);
  408. while ((skb = skb_peek(rcvq)) != NULL &&
  409. udp_lib_checksum_complete(skb)) {
  410. UDP_INC_STATS_BH(UDP_MIB_INERRORS, is_lite);
  411. __skb_unlink(skb, rcvq);
  412. kfree_skb(skb);
  413. }
  414. spin_unlock_bh(&rcvq->lock);
  415. /* nothing to see, move along */
  416. if (skb == NULL)
  417. mask &= ~(POLLIN | POLLRDNORM);
  418. }
  419. return mask;
  420. }
  421. /* ------------------------------------------------------------------------ */
  422. #ifdef CONFIG_PROC_FS
  423. static struct sock *udp_get_first(struct seq_file *seq)
  424. {
  425. struct sock *sk;
  426. struct udp_iter_state *state = seq->private;
  427. for (state->bucket = 0; state->bucket < UDP_HTABLE_SIZE; ++state->bucket) {
  428. struct hlist_node *node;
  429. sk_for_each(sk, node, state->hashtable + state->bucket) {
  430. if (sk->sk_family == state->family)
  431. goto found;
  432. }
  433. }
  434. sk = NULL;
  435. found:
  436. return sk;
  437. }
  438. static struct sock *udp_get_next(struct seq_file *seq, struct sock *sk)
  439. {
  440. struct udp_iter_state *state = seq->private;
  441. do {
  442. sk = sk_next(sk);
  443. try_again:
  444. ;
  445. } while (sk && sk->sk_family != state->family);
  446. if (!sk && ++state->bucket < UDP_HTABLE_SIZE) {
  447. sk = sk_head(state->hashtable + state->bucket);
  448. goto try_again;
  449. }
  450. return sk;
  451. }
  452. static struct sock *udp_get_idx(struct seq_file *seq, loff_t pos)
  453. {
  454. struct sock *sk = udp_get_first(seq);
  455. if (sk)
  456. while (pos && (sk = udp_get_next(seq, sk)) != NULL)
  457. --pos;
  458. return pos ? NULL : sk;
  459. }
  460. static void *udp_seq_start(struct seq_file *seq, loff_t *pos)
  461. __acquires(udp_hash_lock)
  462. {
  463. read_lock(&udp_hash_lock);
  464. return *pos ? udp_get_idx(seq, *pos-1) : (void *)1;
  465. }
  466. static void *udp_seq_next(struct seq_file *seq, void *v, loff_t *pos)
  467. {
  468. struct sock *sk;
  469. if (v == (void *)1)
  470. sk = udp_get_idx(seq, 0);
  471. else
  472. sk = udp_get_next(seq, v);
  473. ++*pos;
  474. return sk;
  475. }
  476. static void udp_seq_stop(struct seq_file *seq, void *v)
  477. __releases(udp_hash_lock)
  478. {
  479. read_unlock(&udp_hash_lock);
  480. }
  481. static int udp_seq_open(struct inode *inode, struct file *file)
  482. {
  483. struct udp_seq_afinfo *afinfo = PDE(inode)->data;
  484. struct seq_file *seq;
  485. int rc = -ENOMEM;
  486. struct udp_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
  487. if (!s)
  488. goto out;
  489. s->family = afinfo->family;
  490. s->hashtable = afinfo->hashtable;
  491. s->seq_ops.start = udp_seq_start;
  492. s->seq_ops.next = udp_seq_next;
  493. s->seq_ops.show = afinfo->seq_show;
  494. s->seq_ops.stop = udp_seq_stop;
  495. rc = seq_open(file, &s->seq_ops);
  496. if (rc)
  497. goto out_kfree;
  498. seq = file->private_data;
  499. seq->private = s;
  500. out:
  501. return rc;
  502. out_kfree:
  503. kfree(s);
  504. goto out;
  505. }
  506. /* ------------------------------------------------------------------------ */
  507. int udp_proc_register(struct udp_seq_afinfo *afinfo)
  508. {
  509. struct proc_dir_entry *p;
  510. int rc = 0;
  511. if (!afinfo)
  512. return -EINVAL;
  513. afinfo->seq_fops->owner = afinfo->owner;
  514. afinfo->seq_fops->open = udp_seq_open;
  515. afinfo->seq_fops->read = seq_read;
  516. afinfo->seq_fops->llseek = seq_lseek;
  517. afinfo->seq_fops->release = seq_release_private;
  518. p = proc_net_fops_create(&init_net, afinfo->name, S_IRUGO, afinfo->seq_fops);
  519. if (p)
  520. p->data = afinfo;
  521. else
  522. rc = -ENOMEM;
  523. return rc;
  524. }
  525. void udp_proc_unregister(struct udp_seq_afinfo *afinfo)
  526. {
  527. if (!afinfo)
  528. return;
  529. proc_net_remove(&init_net, afinfo->name);
  530. memset(afinfo->seq_fops, 0, sizeof(*afinfo->seq_fops));
  531. }
  532. #endif /* CONFIG_PROC_FS */
  533. void __init udp_init(void)
  534. {
  535. unsigned long limit;
  536. /* Set the pressure threshold up by the same strategy of TCP. It is a
  537. * fraction of global memory that is up to 1/2 at 256 MB, decreasing
  538. * toward zero with the amount of memory, with a floor of 128 pages.
  539. */
  540. limit = min(nr_all_pages, 1UL<<(28-PAGE_SHIFT)) >> (20-PAGE_SHIFT);
  541. limit = (limit * (nr_all_pages >> (20-PAGE_SHIFT))) >> (PAGE_SHIFT-11);
  542. limit = max(limit, 128UL);
  543. sysctl_udp_mem[0] = limit / 4 * 3;
  544. sysctl_udp_mem[1] = limit;
  545. sysctl_udp_mem[2] = sysctl_udp_mem[0] * 2;
  546. sysctl_udp_rmem_min = SK_MEM_QUANTUM;
  547. sysctl_udp_wmem_min = SK_MEM_QUANTUM;
  548. }
  549. EXPORT_SYMBOL(udp_disconnect);
  550. EXPORT_SYMBOL(udp_hash);
  551. EXPORT_SYMBOL(udp_hash_lock);
  552. EXPORT_SYMBOL(udp_ioctl);
  553. EXPORT_SYMBOL(udp_get_port);
  554. EXPORT_SYMBOL(udp_lib_getsockopt);
  555. EXPORT_SYMBOL(udp_lib_setsockopt);
  556. EXPORT_SYMBOL(udp_poll);
  557. #ifdef CONFIG_PROC_FS
  558. EXPORT_SYMBOL(udp_proc_register);
  559. EXPORT_SYMBOL(udp_proc_unregister);
  560. #endif