From 800da58e6c4ea433dadfd90a421a08db68ac4254 Mon Sep 17 00:00:00 2001 From: Michael Jung Date: Wed, 2 May 2018 13:53:51 -0600 Subject: [PATCH] fs/nfs/rpc_clnt.c: Commit 091e3f7 broke the NFS client. sendto() can (correctly) no lnoger by used with a connected UDP socket. In that case, send() must be used instead. --- fs/nfs/rpc_clnt.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/nfs/rpc_clnt.c b/fs/nfs/rpc_clnt.c index 61bfe7c6d4..f34c332a8a 100644 --- a/fs/nfs/rpc_clnt.c +++ b/fs/nfs/rpc_clnt.c @@ -1,7 +1,7 @@ /**************************************************************************** * fs/nfs/rpc_clnt.c * - * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013, 2018 Gregory Nutt. All rights reserved. * Copyright (C) 2012 Jose Pablo Rojas Vargas. All rights reserved. * Author: Jose Pablo Rojas Vargas * Gregory Nutt @@ -166,12 +166,12 @@ static int rpcclnt_send(FAR struct rpcclnt *rpc, int procid, int prog, /* Send the call message * - * On success, psock_sendto returns the number of bytes sent; + * On success, psock_send returns the number of bytes sent; * On failure, it returns a negated errno value. */ - nbytes = psock_sendto(rpc->rc_so, call, reqlen, 0, - rpc->rc_name, sizeof(struct sockaddr)); + nbytes = psock_send(rpc->rc_so, call, reqlen, 0); + if (nbytes < 0) { /* psock_sendto failed */ @@ -457,9 +457,9 @@ int rpcclnt_connect(struct rpcclnt *rpc) goto bad; } - /* Protocols that do not require connections may be optionally left - * unconnected for servers that reply from a port other than - * NFS_PORT. + /* Protocols that do not require connections could be optionally left + * unconnected. That would allow servers to reply from a port other than + * the NFS_PORT. */ error = psock_connect(rpc->rc_so, saddr, sizeof(*saddr));