NFS update

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4818 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2012-06-08 18:56:01 +00:00
parent 01f271d392
commit dad99a79d5
4 changed files with 17 additions and 22 deletions

View File

@ -764,7 +764,7 @@ int nfs_readdirrpc(struct nfsmount *nmp, struct nfsnode *np,
}
/* Check for EOF */
#if 0 /* This logic is NOT correct */
if (*ptr != 0)
{
np->n_direofoffset = fxdr_hyper(&dir->u.nfs.cookie[0]);
@ -776,11 +776,11 @@ int nfs_readdirrpc(struct nfsmount *nmp, struct nfsnode *np,
fdbg("End of directory\n");
error = ENOENT;
}
#endif
/* Otherwise, there is an entry. Get the file ID and point to the length */
/* Missing logic to get the file ID */
// dir->fd_dir.d_type = entry->fileid;
#warning "This must match the type values in dirent.h"
ptr += 2;
/* Get the length and point to the name */
@ -807,7 +807,13 @@ int nfs_readdirrpc(struct nfsmount *nmp, struct nfsnode *np,
ptr++; /* Just skip over the nextentry for now */
/* Return the Type of the node to the caller */
/* MISSING LOGIC */
/* MISSING LOGIC TO DETERMINE FILE TYPE -- Need to (1) get nfstype, and (2)
* map NFREG, NFDIR, etc. to values in dirent.h.
*/
dir->fd_dir.d_type = DTYPE_FILE;
// dir->fd_dir.d_type = entry->fileid;
#warning "This must match the type values in dirent.h"
/* Return the name of the node to the caller */

View File

@ -387,14 +387,12 @@ struct rpc_reply_header
struct rpc_reply_pmap
{
struct rpc_reply_header rh;
uint32_t status;
struct call_result_pmap pmap;
};
struct rpc_reply_mount
{
struct rpc_reply_header rh;
uint32_t status;
struct call_result_mount mount;
};

View File

@ -465,7 +465,6 @@ static int rpcclnt_receive(struct rpctask *rep, struct sockaddr *aname,
uint32_t len;
int sotype;
#endif
int rcvflg;
int error = 0;
int errval;
@ -541,9 +540,8 @@ static int rpcclnt_receive(struct rpctask *rep, struct sockaddr *aname,
do
{
socklen_t fromlen = sizeof(*rep->r_rpcclnt->rc_name)
rcvflg = MSG_WAITALL;
nbytes = psock_recvfrom(so, reply, len,
&rcvflg, rep->r_rpcclnt->rc_name,
MSG_WAITALL, rep->r_rpcclnt->rc_name,
&fromlen);
if (nbytes < 0)
{
@ -597,9 +595,8 @@ static int rpcclnt_receive(struct rpctask *rep, struct sockaddr *aname,
do
{
socklen_t fromlen = sizeof(*rep->r_rpcclnt->rc_name);
rcvflg = MSG_WAITALL;
nbytes = psock_recvfrom(so, reply, sizeof(*reply),
&rcvflg, rep->r_rpcclnt->rc_name,
MSG_WAITALL, rep->r_rpcclnt->rc_name,
&fromlen);
if (nbytes < 0)
{
@ -640,8 +637,7 @@ static int rpcclnt_receive(struct rpctask *rep, struct sockaddr *aname,
do
{
socklen_t fromlen = sizeof(*rep->r_rpcclnt->rc_name);
rcvflg = 0;
nbytes = psock_recvfrom(so, reply, sizeof(*reply), &rcvflg,
nbytes = psock_recvfrom(so, reply, sizeof(*reply), 0,
rep->r_rpcclnt->rc_name, &fromlen);
if (nbytes < 0)
{
@ -659,11 +655,6 @@ static int rpcclnt_receive(struct rpctask *rep, struct sockaddr *aname,
}
while (errval == EWOULDBLOCK || nbytes == 0);
if ((rcvflg & MSG_EOR) == 0)
{
fdbg("Egad!!\n");
}
if (nbytes < 0)
{
error = errval;
@ -714,8 +705,7 @@ static int rpcclnt_receive(struct rpctask *rep, struct sockaddr *aname,
}
socklen_t fromlen = sizeof(struct sockaddr);
rcvflg = 0;
nbytes = psock_recvfrom(so, reply, len, rcvflg, aname, &fromlen);
nbytes = psock_recvfrom(so, reply, len, 0, aname, &fromlen);
if (nbytes < 0)
{
errval = errno;

View File

@ -1,8 +1,8 @@
/****************************************************************************
* net/uip/uip_udpconn.c
*
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Large parts of this file were leveraged from uIP logic:
*
@ -313,6 +313,7 @@ struct uip_udp_conn *uip_udpactive(struct uip_udpip_hdr *buf)
uiphdr_ipaddr_cmp(buf->srcipaddr, &conn->ripaddr)))
{
/* Matching connection found.. return a reference to it */
break;
}