/**
* nfs_sockaddr2universal - convert a sockaddr to a "universal address"
* @sap: pointer to a socket address
- * @salen: length of socket address
*
* Universal addresses (defined in RFC 1833) are used when calling an
* rpcbind daemon via protocol versions 3 or 4..
* in some earlier glibc releases, and we don't require support for
* scope IDs for universal addresses.
*/
-char *nfs_sockaddr2universal(const struct sockaddr *sap,
- const socklen_t salen)
+char *nfs_sockaddr2universal(const struct sockaddr *sap)
{
const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)sap;
const struct sockaddr_un *sun = (const struct sockaddr_un *)sap;
* to by r_netid and r_addr; otherwise 0.
*/
static int nfs_gp_init_rpcb_parms(const struct sockaddr *sap,
- const socklen_t salen,
const rpcprog_t program,
const rpcvers_t version,
const unsigned short protocol,
if (netid == NULL)
return 0;
- addr = nfs_sockaddr2universal(sap, salen);
+ addr = nfs_sockaddr2universal(sap);
if (addr == NULL) {
free(netid);
return 0;
static unsigned short nfs_gp_getport_rpcb(CLIENT *client,
const struct sockaddr *sap,
- const socklen_t salen,
const rpcprog_t program,
const rpcvers_t version,
const unsigned short protocol,
unsigned short port = 0;
struct rpcb parms;
- if (nfs_gp_init_rpcb_parms(sap, salen, program,
- version, protocol, &parms) != 0) {
+ if (nfs_gp_init_rpcb_parms(sap, program, version,
+ protocol, &parms) != 0) {
port = nfs_gp_rpcb_getaddr(client, &parms, timeout);
nfs_gp_free_rpcb_parms(&parms);
}
*/
static unsigned short nfs_gp_getport(CLIENT *client,
const struct sockaddr *sap,
- const socklen_t salen,
const rpcprog_t program,
const rpcvers_t version,
const unsigned short protocol,
switch (sap->sa_family) {
#ifdef HAVE_LIBTIRPC
case AF_INET6:
- return nfs_gp_getport_rpcb(client, sap, salen, program,
+ return nfs_gp_getport_rpcb(client, sap, program,
version, protocol, timeout);
#endif /* HAVE_LIBTIRPC */
case AF_INET:
client = nfs_gp_get_rpcbclient(saddr, salen, protocol,
default_rpcb_version, &timeout);
if (client != NULL) {
- port = nfs_gp_getport(client, saddr, salen, program,
+ port = nfs_gp_getport(client, saddr, program,
version, protocol, timeout);
CLNT_DESTROY(client);
}
client = nfs_gp_get_rpcbclient(sap, salen, protocol,
default_rpcb_version, &timeout);
if (client != NULL) {
- port = nfs_gp_getport(client, sap, salen, program,
+ port = nfs_gp_getport(client, sap, program,
version, protocol, timeout);
CLNT_DESTROY(client);
client = NULL;
if (client != NULL) {
struct rpcb parms;
- if (nfs_gp_init_rpcb_parms(sap, salen, program, version,
+ if (nfs_gp_init_rpcb_parms(sap, program, version,
protocol, &parms) != 0) {
port = nfs_gp_rpcb_getaddr(client, &parms, timeout);
nfs_gp_free_rpcb_parms(&parms);
* @salen: length of server address
* @transport: transport protocol to use for the query
* @addr: pointer to r_addr address
- * @addrlen: length of address
* @program: requested RPC program number
* @version: requested RPC version number
* @protocol: requested IPPROTO_ value of transport protocol
const socklen_t salen,
const unsigned short transport,
const struct sockaddr *addr,
- const socklen_t addrlen,
const rpcprog_t program,
const rpcvers_t version,
const unsigned short protocol,
client = nfs_gp_get_rpcbclient(saddr, salen, transport,
RPCBVERS_4, &tout);
if (client != NULL) {
- if (nfs_gp_init_rpcb_parms(addr, addrlen, program, version,
+ if (nfs_gp_init_rpcb_parms(addr, program, version,
protocol, &parms) != 0) {
port = nfs_gp_rpcb_getaddr(client, &parms, tout);
nfs_gp_free_rpcb_parms(&parms);
#else /* !HAVE_LIBTIRPC */
-unsigned short nfs_rpcb_getaddr(const struct sockaddr *sap,
- const socklen_t salen,
- const unsigned short transport,
- const struct sockaddr *addr,
- const socklen_t addrlen,
- const rpcprog_t program,
- const rpcvers_t version,
- const unsigned short protocol,
- const struct timeval *timeout)
+unsigned short nfs_rpcb_getaddr(__attribute__((unused)) const struct sockaddr *sap,
+ __attribute__((unused)) const socklen_t salen,
+ __attribute__((unused)) const unsigned short transport,
+ __attribute__((unused)) const struct sockaddr *addr,
+ __attribute__((unused)) const rpcprog_t program,
+ __attribute__((unused)) const rpcvers_t version,
+ __attribute__((unused)) const unsigned short protocol,
+ __attribute__((unused)) const struct timeval *timeout)
{
rpc_createerr.cf_stat = RPC_UNKNOWNADDR;
return 0;