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