svc_udp.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. /* @(#)svc_udp.c 2.2 88/07/29 4.0 RPCSRC */
  2. /*
  3. * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  4. * unrestricted use provided that this legend is included on all tape
  5. * media and as a part of the software program in whole or part. Users
  6. * may copy or modify Sun RPC without charge, but are not authorized
  7. * to license or distribute it to anyone else except as part of a product or
  8. * program developed by the user.
  9. *
  10. * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  11. * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  12. * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  13. *
  14. * Sun RPC is provided with no support and without any obligation on the
  15. * part of Sun Microsystems, Inc. to assist in its use, correction,
  16. * modification or enhancement.
  17. *
  18. * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  19. * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  20. * OR ANY PART THEREOF.
  21. *
  22. * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  23. * or profits or other special, indirect and consequential damages, even if
  24. * Sun has been advised of the possibility of such damages.
  25. *
  26. * Sun Microsystems, Inc.
  27. * 2550 Garcia Avenue
  28. * Mountain View, California 94043
  29. */
  30. #if 0
  31. static char sccsid[] = "@(#)svc_udp.c 1.24 87/08/11 Copyr 1984 Sun Micro";
  32. #endif
  33. /*
  34. * svc_udp.c,
  35. * Server side for UDP/IP based RPC. (Does some caching in the hopes of
  36. * achieving execute-at-most-once semantics.)
  37. *
  38. * Copyright (C) 1984, Sun Microsystems, Inc.
  39. */
  40. #define __FORCE_GLIBC
  41. #define _GNU_SOURCE
  42. #include <features.h>
  43. #include <stdio.h>
  44. #include <unistd.h>
  45. #include <string.h>
  46. #include <rpc/rpc.h>
  47. #include <sys/socket.h>
  48. #include <errno.h>
  49. #ifdef IP_PKTINFO
  50. #include <sys/uio.h>
  51. #endif
  52. #ifdef USE_IN_LIBIO
  53. # include <wchar.h>
  54. # include <libio/iolibio.h>
  55. # define fputs(s, f) _IO_fputs (s, f)
  56. #endif
  57. #define rpc_buffer(xprt) ((xprt)->xp_p1)
  58. #ifndef MAX
  59. #define MAX(a, b) ((a > b) ? a : b)
  60. #endif
  61. static bool_t svcudp_recv (SVCXPRT *, struct rpc_msg *);
  62. static bool_t svcudp_reply (SVCXPRT *, struct rpc_msg *);
  63. static enum xprt_stat svcudp_stat (SVCXPRT *);
  64. static bool_t svcudp_getargs (SVCXPRT *, xdrproc_t, caddr_t);
  65. static bool_t svcudp_freeargs (SVCXPRT *, xdrproc_t, caddr_t);
  66. static void svcudp_destroy (SVCXPRT *);
  67. static const struct xp_ops svcudp_op =
  68. {
  69. svcudp_recv,
  70. svcudp_stat,
  71. svcudp_getargs,
  72. svcudp_reply,
  73. svcudp_freeargs,
  74. svcudp_destroy
  75. };
  76. static int cache_get (SVCXPRT *, struct rpc_msg *, char **replyp,
  77. u_long *replylenp);
  78. static void cache_set (SVCXPRT *xprt, u_long replylen);
  79. /*
  80. * kept in xprt->xp_p2
  81. */
  82. struct svcudp_data
  83. {
  84. u_int su_iosz; /* byte size of send.recv buffer */
  85. u_long su_xid; /* transaction id */
  86. XDR su_xdrs; /* XDR handle */
  87. char su_verfbody[MAX_AUTH_BYTES]; /* verifier body */
  88. char *su_cache; /* cached data, NULL if no cache */
  89. };
  90. #define su_data(xprt) ((struct svcudp_data *)(xprt->xp_p2))
  91. /*
  92. * Usage:
  93. * xprt = svcudp_create(sock);
  94. *
  95. * If sock<0 then a socket is created, else sock is used.
  96. * If the socket, sock is not bound to a port then svcudp_create
  97. * binds it to an arbitrary port. In any (successful) case,
  98. * xprt->xp_sock is the registered socket number and xprt->xp_port is the
  99. * associated port number.
  100. * Once *xprt is initialized, it is registered as a transporter;
  101. * see (svc.h, xprt_register).
  102. * The routines returns NULL if a problem occurred.
  103. */
  104. SVCXPRT *
  105. svcudp_bufcreate (sock, sendsz, recvsz)
  106. int sock;
  107. u_int sendsz, recvsz;
  108. {
  109. bool_t madesock = FALSE;
  110. SVCXPRT *xprt;
  111. struct svcudp_data *su;
  112. struct sockaddr_in addr;
  113. socklen_t len = sizeof (struct sockaddr_in);
  114. int pad;
  115. void *buf;
  116. if (sock == RPC_ANYSOCK)
  117. {
  118. if ((sock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
  119. {
  120. perror (_("svcudp_create: socket creation problem"));
  121. return (SVCXPRT *) NULL;
  122. }
  123. madesock = TRUE;
  124. }
  125. memset ((char *) &addr, 0, sizeof (addr));
  126. addr.sin_family = AF_INET;
  127. if (bindresvport (sock, &addr))
  128. {
  129. addr.sin_port = 0;
  130. (void) bind (sock, (struct sockaddr *) &addr, len);
  131. }
  132. if (getsockname (sock, (struct sockaddr *) &addr, &len) != 0)
  133. {
  134. perror (_("svcudp_create - cannot getsockname"));
  135. if (madesock)
  136. (void) close (sock);
  137. return (SVCXPRT *) NULL;
  138. }
  139. xprt = (SVCXPRT *) mem_alloc (sizeof (SVCXPRT));
  140. su = (struct svcudp_data *) mem_alloc (sizeof (*su));
  141. buf = mem_alloc (((MAX (sendsz, recvsz) + 3) / 4) * 4);
  142. if (xprt == NULL || su == NULL || buf == NULL)
  143. {
  144. #ifdef USE_IN_LIBIO
  145. if (_IO_fwide (stderr, 0) > 0)
  146. (void) __fwprintf (stderr, L"%s", _("svcudp_create: out of memory\n"));
  147. else
  148. #endif
  149. (void) fputs (_("svcudp_create: out of memory\n"), stderr);
  150. mem_free (xprt, sizeof (SVCXPRT));
  151. mem_free (su, sizeof (*su));
  152. mem_free (buf, ((MAX (sendsz, recvsz) + 3) / 4) * 4);
  153. return NULL;
  154. }
  155. su->su_iosz = ((MAX (sendsz, recvsz) + 3) / 4) * 4;
  156. rpc_buffer (xprt) = buf;
  157. xdrmem_create (&(su->su_xdrs), rpc_buffer (xprt), su->su_iosz, XDR_DECODE);
  158. su->su_cache = NULL;
  159. xprt->xp_p2 = (caddr_t) su;
  160. xprt->xp_verf.oa_base = su->su_verfbody;
  161. xprt->xp_ops = &svcudp_op;
  162. xprt->xp_port = ntohs (addr.sin_port);
  163. xprt->xp_sock = sock;
  164. #ifdef IP_PKTINFO
  165. if ((sizeof (struct iovec) + sizeof (struct msghdr)
  166. + sizeof(struct cmsghdr) + sizeof (struct in_pktinfo))
  167. > sizeof (xprt->xp_pad))
  168. {
  169. # ifdef USE_IN_LIBIO
  170. if (_IO_fwide (stderr, 0) > 0)
  171. (void) __fwprintf (stderr, L"%s",
  172. _("svcudp_create: xp_pad is too small for IP_PKTINFO\n"));
  173. else
  174. # endif
  175. (void) fputs (_("svcudp_create: xp_pad is too small for IP_PKTINFO\n"),
  176. stderr);
  177. return NULL;
  178. }
  179. pad = 1;
  180. if (setsockopt (sock, SOL_IP, IP_PKTINFO, (void *) &pad,
  181. sizeof (pad)) == 0)
  182. /* Set the padding to all 1s. */
  183. pad = 0xff;
  184. else
  185. #endif
  186. /* Clear the padding. */
  187. pad = 0;
  188. memset (&xprt->xp_pad [0], pad, sizeof (xprt->xp_pad));
  189. xprt_register (xprt);
  190. return xprt;
  191. }
  192. SVCXPRT *
  193. svcudp_create (sock)
  194. int sock;
  195. {
  196. return svcudp_bufcreate (sock, UDPMSGSIZE, UDPMSGSIZE);
  197. }
  198. static enum xprt_stat
  199. svcudp_stat (xprt)
  200. SVCXPRT *xprt;
  201. {
  202. return XPRT_IDLE;
  203. }
  204. static bool_t
  205. svcudp_recv (xprt, msg)
  206. SVCXPRT *xprt;
  207. struct rpc_msg *msg;
  208. {
  209. struct svcudp_data *su = su_data (xprt);
  210. XDR *xdrs = &(su->su_xdrs);
  211. int rlen;
  212. char *reply;
  213. u_long replylen;
  214. socklen_t len;
  215. /* It is very tricky when you have IP aliases. We want to make sure
  216. that we are sending the packet from the IP address where the
  217. incoming packet is addressed to. H.J. */
  218. #ifdef IP_PKTINFO
  219. struct iovec *iovp;
  220. struct msghdr *mesgp;
  221. #endif
  222. again:
  223. /* FIXME -- should xp_addrlen be a size_t? */
  224. len = (socklen_t) sizeof(struct sockaddr_in);
  225. #ifdef IP_PKTINFO
  226. iovp = (struct iovec *) &xprt->xp_pad [0];
  227. mesgp = (struct msghdr *) &xprt->xp_pad [sizeof (struct iovec)];
  228. if (mesgp->msg_iovlen)
  229. {
  230. iovp->iov_base = rpc_buffer (xprt);
  231. iovp->iov_len = su->su_iosz;
  232. mesgp->msg_iov = iovp;
  233. mesgp->msg_iovlen = 1;
  234. mesgp->msg_name = &(xprt->xp_raddr);
  235. mesgp->msg_namelen = len;
  236. mesgp->msg_control = &xprt->xp_pad [sizeof (struct iovec)
  237. + sizeof (struct msghdr)];
  238. mesgp->msg_controllen = sizeof(xprt->xp_pad)
  239. - sizeof (struct iovec) - sizeof (struct msghdr);
  240. rlen = recvmsg (xprt->xp_sock, mesgp, 0);
  241. if (rlen >= 0)
  242. len = mesgp->msg_namelen;
  243. }
  244. else
  245. #endif
  246. rlen = recvfrom (xprt->xp_sock, rpc_buffer (xprt),
  247. (int) su->su_iosz, 0,
  248. (struct sockaddr *) &(xprt->xp_raddr), &len);
  249. xprt->xp_addrlen = len;
  250. if (rlen == -1 && errno == EINTR)
  251. goto again;
  252. if (rlen < 16) /* < 4 32-bit ints? */
  253. return FALSE;
  254. xdrs->x_op = XDR_DECODE;
  255. XDR_SETPOS (xdrs, 0);
  256. if (!xdr_callmsg (xdrs, msg))
  257. return FALSE;
  258. su->su_xid = msg->rm_xid;
  259. if (su->su_cache != NULL)
  260. {
  261. if (cache_get (xprt, msg, &reply, &replylen))
  262. {
  263. #ifdef IP_PKTINFO
  264. if (mesgp->msg_iovlen)
  265. {
  266. iovp->iov_base = reply;
  267. iovp->iov_len = replylen;
  268. (void) sendmsg (xprt->xp_sock, mesgp, 0);
  269. }
  270. else
  271. #endif
  272. (void) sendto (xprt->xp_sock, reply, (int) replylen, 0,
  273. (struct sockaddr *) &xprt->xp_raddr, len);
  274. return TRUE;
  275. }
  276. }
  277. return TRUE;
  278. }
  279. static bool_t
  280. svcudp_reply (xprt, msg)
  281. SVCXPRT *xprt;
  282. struct rpc_msg *msg;
  283. {
  284. struct svcudp_data *su = su_data (xprt);
  285. XDR *xdrs = &(su->su_xdrs);
  286. int slen, sent;
  287. bool_t stat = FALSE;
  288. #ifdef IP_PKTINFO
  289. struct iovec *iovp;
  290. struct msghdr *mesgp;
  291. #endif
  292. xdrs->x_op = XDR_ENCODE;
  293. XDR_SETPOS (xdrs, 0);
  294. msg->rm_xid = su->su_xid;
  295. if (xdr_replymsg (xdrs, msg))
  296. {
  297. slen = (int) XDR_GETPOS (xdrs);
  298. #ifdef IP_PKTINFO
  299. mesgp = (struct msghdr *) &xprt->xp_pad [sizeof (struct iovec)];
  300. if (mesgp->msg_iovlen)
  301. {
  302. iovp = (struct iovec *) &xprt->xp_pad [0];
  303. iovp->iov_base = rpc_buffer (xprt);
  304. iovp->iov_len = slen;
  305. sent = sendmsg (xprt->xp_sock, mesgp, 0);
  306. }
  307. else
  308. #endif
  309. sent = sendto (xprt->xp_sock, rpc_buffer (xprt), slen, 0,
  310. (struct sockaddr *) &(xprt->xp_raddr),
  311. xprt->xp_addrlen);
  312. if (sent == slen)
  313. {
  314. stat = TRUE;
  315. if (su->su_cache && slen >= 0)
  316. {
  317. cache_set (xprt, (u_long) slen);
  318. }
  319. }
  320. }
  321. return stat;
  322. }
  323. static bool_t
  324. svcudp_getargs (xprt, xdr_args, args_ptr)
  325. SVCXPRT *xprt;
  326. xdrproc_t xdr_args;
  327. caddr_t args_ptr;
  328. {
  329. return (*xdr_args) (&(su_data (xprt)->su_xdrs), args_ptr);
  330. }
  331. static bool_t
  332. svcudp_freeargs (xprt, xdr_args, args_ptr)
  333. SVCXPRT *xprt;
  334. xdrproc_t xdr_args;
  335. caddr_t args_ptr;
  336. {
  337. XDR *xdrs = &(su_data (xprt)->su_xdrs);
  338. xdrs->x_op = XDR_FREE;
  339. return (*xdr_args) (xdrs, args_ptr);
  340. }
  341. static void
  342. svcudp_destroy (xprt)
  343. SVCXPRT *xprt;
  344. {
  345. struct svcudp_data *su = su_data (xprt);
  346. xprt_unregister (xprt);
  347. (void) close (xprt->xp_sock);
  348. XDR_DESTROY (&(su->su_xdrs));
  349. mem_free (rpc_buffer (xprt), su->su_iosz);
  350. mem_free ((caddr_t) su, sizeof (struct svcudp_data));
  351. mem_free ((caddr_t) xprt, sizeof (SVCXPRT));
  352. }
  353. /***********this could be a separate file*********************/
  354. /*
  355. * Fifo cache for udp server
  356. * Copies pointers to reply buffers into fifo cache
  357. * Buffers are sent again if retransmissions are detected.
  358. */
  359. #define SPARSENESS 4 /* 75% sparse */
  360. #ifdef USE_IN_LIBIO
  361. # define CACHE_PERROR(msg) \
  362. if (_IO_fwide (stderr, 0) > 0) \
  363. (void) __fwprintf(stderr, L"%s\n", msg); \
  364. else \
  365. (void) fprintf(stderr, "%s\n", msg)
  366. #else
  367. # define CACHE_PERROR(msg) \
  368. (void) fprintf(stderr,"%s\n", msg)
  369. #endif
  370. #define ALLOC(type, size) \
  371. (type *) mem_alloc((unsigned) (sizeof(type) * (size)))
  372. #define BZERO(addr, type, size) \
  373. memset((char *) addr, 0, sizeof(type) * (int) (size))
  374. /*
  375. * An entry in the cache
  376. */
  377. typedef struct cache_node *cache_ptr;
  378. struct cache_node
  379. {
  380. /*
  381. * Index into cache is xid, proc, vers, prog and address
  382. */
  383. u_long cache_xid;
  384. u_long cache_proc;
  385. u_long cache_vers;
  386. u_long cache_prog;
  387. struct sockaddr_in cache_addr;
  388. /*
  389. * The cached reply and length
  390. */
  391. char *cache_reply;
  392. u_long cache_replylen;
  393. /*
  394. * Next node on the list, if there is a collision
  395. */
  396. cache_ptr cache_next;
  397. };
  398. /*
  399. * The entire cache
  400. */
  401. struct udp_cache
  402. {
  403. u_long uc_size; /* size of cache */
  404. cache_ptr *uc_entries; /* hash table of entries in cache */
  405. cache_ptr *uc_fifo; /* fifo list of entries in cache */
  406. u_long uc_nextvictim; /* points to next victim in fifo list */
  407. u_long uc_prog; /* saved program number */
  408. u_long uc_vers; /* saved version number */
  409. u_long uc_proc; /* saved procedure number */
  410. struct sockaddr_in uc_addr; /* saved caller's address */
  411. };
  412. /*
  413. * the hashing function
  414. */
  415. #define CACHE_LOC(transp, xid) \
  416. (xid % (SPARSENESS*((struct udp_cache *) su_data(transp)->su_cache)->uc_size))
  417. /*
  418. * Enable use of the cache.
  419. * Note: there is no disable.
  420. */
  421. int
  422. svcudp_enablecache (SVCXPRT *transp, u_long size)
  423. {
  424. struct svcudp_data *su = su_data (transp);
  425. struct udp_cache *uc;
  426. if (su->su_cache != NULL)
  427. {
  428. CACHE_PERROR (_("enablecache: cache already enabled"));
  429. return 0;
  430. }
  431. uc = ALLOC (struct udp_cache, 1);
  432. if (uc == NULL)
  433. {
  434. CACHE_PERROR (_("enablecache: could not allocate cache"));
  435. return 0;
  436. }
  437. uc->uc_size = size;
  438. uc->uc_nextvictim = 0;
  439. uc->uc_entries = ALLOC (cache_ptr, size * SPARSENESS);
  440. if (uc->uc_entries == NULL)
  441. {
  442. CACHE_PERROR (_("enablecache: could not allocate cache data"));
  443. return 0;
  444. }
  445. BZERO (uc->uc_entries, cache_ptr, size * SPARSENESS);
  446. uc->uc_fifo = ALLOC (cache_ptr, size);
  447. if (uc->uc_fifo == NULL)
  448. {
  449. CACHE_PERROR (_("enablecache: could not allocate cache fifo"));
  450. return 0;
  451. }
  452. BZERO (uc->uc_fifo, cache_ptr, size);
  453. su->su_cache = (char *) uc;
  454. return 1;
  455. }
  456. /*
  457. * Set an entry in the cache
  458. */
  459. static void
  460. cache_set (SVCXPRT *xprt, u_long replylen)
  461. {
  462. cache_ptr victim;
  463. cache_ptr *vicp;
  464. struct svcudp_data *su = su_data (xprt);
  465. struct udp_cache *uc = (struct udp_cache *) su->su_cache;
  466. u_int loc;
  467. char *newbuf;
  468. /*
  469. * Find space for the new entry, either by
  470. * reusing an old entry, or by mallocing a new one
  471. */
  472. victim = uc->uc_fifo[uc->uc_nextvictim];
  473. if (victim != NULL)
  474. {
  475. loc = CACHE_LOC (xprt, victim->cache_xid);
  476. for (vicp = &uc->uc_entries[loc];
  477. *vicp != NULL && *vicp != victim;
  478. vicp = &(*vicp)->cache_next)
  479. ;
  480. if (*vicp == NULL)
  481. {
  482. CACHE_PERROR (_("cache_set: victim not found"));
  483. return;
  484. }
  485. *vicp = victim->cache_next; /* remote from cache */
  486. newbuf = victim->cache_reply;
  487. }
  488. else
  489. {
  490. victim = ALLOC (struct cache_node, 1);
  491. if (victim == NULL)
  492. {
  493. CACHE_PERROR (_("cache_set: victim alloc failed"));
  494. return;
  495. }
  496. newbuf = mem_alloc (su->su_iosz);
  497. if (newbuf == NULL)
  498. {
  499. CACHE_PERROR (_("cache_set: could not allocate new rpc_buffer"));
  500. return;
  501. }
  502. }
  503. /*
  504. * Store it away
  505. */
  506. victim->cache_replylen = replylen;
  507. victim->cache_reply = rpc_buffer (xprt);
  508. rpc_buffer (xprt) = newbuf;
  509. xdrmem_create (&(su->su_xdrs), rpc_buffer (xprt), su->su_iosz, XDR_ENCODE);
  510. victim->cache_xid = su->su_xid;
  511. victim->cache_proc = uc->uc_proc;
  512. victim->cache_vers = uc->uc_vers;
  513. victim->cache_prog = uc->uc_prog;
  514. victim->cache_addr = uc->uc_addr;
  515. loc = CACHE_LOC (xprt, victim->cache_xid);
  516. victim->cache_next = uc->uc_entries[loc];
  517. uc->uc_entries[loc] = victim;
  518. uc->uc_fifo[uc->uc_nextvictim++] = victim;
  519. uc->uc_nextvictim %= uc->uc_size;
  520. }
  521. /*
  522. * Try to get an entry from the cache
  523. * return 1 if found, 0 if not found
  524. */
  525. static int
  526. cache_get (xprt, msg, replyp, replylenp)
  527. SVCXPRT *xprt;
  528. struct rpc_msg *msg;
  529. char **replyp;
  530. u_long *replylenp;
  531. {
  532. u_int loc;
  533. cache_ptr ent;
  534. struct svcudp_data *su = su_data (xprt);
  535. struct udp_cache *uc = (struct udp_cache *) su->su_cache;
  536. #define EQADDR(a1, a2) (memcmp((char*)&a1, (char*)&a2, sizeof(a1)) == 0)
  537. loc = CACHE_LOC (xprt, su->su_xid);
  538. for (ent = uc->uc_entries[loc]; ent != NULL; ent = ent->cache_next)
  539. {
  540. if (ent->cache_xid == su->su_xid &&
  541. ent->cache_proc == uc->uc_proc &&
  542. ent->cache_vers == uc->uc_vers &&
  543. ent->cache_prog == uc->uc_prog &&
  544. EQADDR (ent->cache_addr, uc->uc_addr))
  545. {
  546. *replyp = ent->cache_reply;
  547. *replylenp = ent->cache_replylen;
  548. return 1;
  549. }
  550. }
  551. /*
  552. * Failed to find entry
  553. * Remember a few things so we can do a set later
  554. */
  555. uc->uc_proc = msg->rm_call.cb_proc;
  556. uc->uc_vers = msg->rm_call.cb_vers;
  557. uc->uc_prog = msg->rm_call.cb_prog;
  558. memcpy (&uc->uc_addr, &xprt->xp_raddr, sizeof (uc->uc_addr));
  559. return 0;
  560. }