rpcb_clnt.c (1.9) | rpcb_clnt.c (1.10) |
---|---|
1/* $NetBSD: rpcb_clnt.c,v 1.9 2001/09/27 18:59:37 jdolecek Exp $ */ | 1/* $NetBSD: rpcb_clnt.c,v 1.10 2001/11/04 14:43:55 lukem Exp $ */ |
2 3/* 4 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 5 * unrestricted use provided that this legend is included on all tape 6 * media and as a part of the software program in whole or part. Users 7 * may copy or modify Sun RPC without charge, but are not authorized 8 * to license or distribute it to anyone else except as part of a product or 9 * program developed by the user. --- 448 unchanged lines hidden (view full) --- 458 nbuf.len = sun.sun_len = SUN_LEN(&sun); 459 nbuf.maxlen = sizeof (struct sockaddr_un); 460 nbuf.buf = &sun; 461 462 tsize = __rpc_get_t_size(AF_LOCAL, 0, 0); 463 client = clnt_vc_create(sock, &nbuf, (rpcprog_t)RPCBPROG, 464 (rpcvers_t)RPCBVERS, tsize, tsize); 465 | 2 3/* 4 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 5 * unrestricted use provided that this legend is included on all tape 6 * media and as a part of the software program in whole or part. Users 7 * may copy or modify Sun RPC without charge, but are not authorized 8 * to license or distribute it to anyone else except as part of a product or 9 * program developed by the user. --- 448 unchanged lines hidden (view full) --- 458 nbuf.len = sun.sun_len = SUN_LEN(&sun); 459 nbuf.maxlen = sizeof (struct sockaddr_un); 460 nbuf.buf = &sun; 461 462 tsize = __rpc_get_t_size(AF_LOCAL, 0, 0); 463 client = clnt_vc_create(sock, &nbuf, (rpcprog_t)RPCBPROG, 464 (rpcvers_t)RPCBVERS, tsize, tsize); 465 |
466 if (client != NULL) | 466 if (client != NULL) { 467 /* XXX - mark the socket to be closed in destructor */ 468 (void) CLNT_CONTROL(client, CLSET_FD_CLOSE, NULL); |
467 return client; | 469 return client; |
470 } |
|
468 | 471 |
472 /* XXX - nobody needs this socket anymore, free the descriptor */ 473 close(sock); 474 |
|
469try_nconf: 470 471/* VARIABLES PROTECTED BY loopnconf_lock: loopnconf */ 472 mutex_lock(&loopnconf_lock); 473 if (loopnconf == NULL) { 474 struct netconfig *nconf, *tmpnconf = NULL; 475 void *nc_handle; 476 int fd; --- 74 unchanged lines hidden (view full) --- 551 return (FALSE); 552 } 553 554 /* convert to universal */ 555 /*LINTED const castaway*/ 556 parms.r_addr = taddr2uaddr((struct netconfig *) nconf, 557 (struct netbuf *)address); 558 if (!parms.r_addr) { | 475try_nconf: 476 477/* VARIABLES PROTECTED BY loopnconf_lock: loopnconf */ 478 mutex_lock(&loopnconf_lock); 479 if (loopnconf == NULL) { 480 struct netconfig *nconf, *tmpnconf = NULL; 481 void *nc_handle; 482 int fd; --- 74 unchanged lines hidden (view full) --- 557 return (FALSE); 558 } 559 560 /* convert to universal */ 561 /*LINTED const castaway*/ 562 parms.r_addr = taddr2uaddr((struct netconfig *) nconf, 563 (struct netbuf *)address); 564 if (!parms.r_addr) { |
565 CLNT_DESTROY(client); |
|
559 rpc_createerr.cf_stat = RPC_N2AXLATEFAILURE; 560 return (FALSE); /* no universal address */ 561 } 562 parms.r_prog = program; 563 parms.r_vers = version; 564 parms.r_netid = nconf->nc_netid; 565 /* 566 * Though uid is not being used directly, we still send it for --- 725 unchanged lines hidden --- | 566 rpc_createerr.cf_stat = RPC_N2AXLATEFAILURE; 567 return (FALSE); /* no universal address */ 568 } 569 parms.r_prog = program; 570 parms.r_vers = version; 571 parms.r_netid = nconf->nc_netid; 572 /* 573 * Though uid is not being used directly, we still send it for --- 725 unchanged lines hidden --- |