aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorGuillaume GARDET <guillaume.gardet@free.fr>2016-06-06 15:11:45 +0200
committerJoe Hershberger <joe.hershberger@ni.com>2016-06-21 17:01:52 -0500
commit69fd0d4131c73a3b8a199a8d88fb4e5c688b58d5 (patch)
tree07469b166460944497a1204fed6a671770c23a04 /net
parent08e64cece2f8e793b5c085ebf27c27dfc5ed730d (diff)
downloadu-boot-69fd0d4131c73a3b8a199a8d88fb4e5c688b58d5.zip
u-boot-69fd0d4131c73a3b8a199a8d88fb4e5c688b58d5.tar.gz
u-boot-69fd0d4131c73a3b8a199a8d88fb4e5c688b58d5.tar.bz2
NFS: Add error message when U-Boot NFS version (V2) is not supported by NFS server
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr> Cc: joe.hershberger@ni.com Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'net')
-rw-r--r--net/nfs.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/net/nfs.c b/net/nfs.c
index 78968d8..f60a037 100644
--- a/net/nfs.c
+++ b/net/nfs.c
@@ -481,8 +481,23 @@ static int nfs_lookup_reply(uchar *pkt, unsigned len)
if (rpc_pkt.u.reply.rstatus ||
rpc_pkt.u.reply.verifier ||
rpc_pkt.u.reply.astatus ||
- rpc_pkt.u.reply.data[0])
+ rpc_pkt.u.reply.data[0]) {
+ switch (ntohl(rpc_pkt.u.reply.astatus)) {
+ case 0: /* Not an error */
+ break;
+ case 2: /* Remote can't support NFS version */
+ printf("*** ERROR: NFS version not supported: Requested: V%d, accepted: min V%d - max V%d\n",
+ 2,
+ ntohl(rpc_pkt.u.reply.data[0]),
+ ntohl(rpc_pkt.u.reply.data[1]));
+ break;
+ default: /* Unknown error on 'accept state' flag */
+ printf("*** ERROR: accept state error (%d)\n",
+ ntohl(rpc_pkt.u.reply.astatus));
+ break;
+ }
return -1;
+ }
memcpy(filefh, rpc_pkt.u.reply.data + 1, NFS_FHSIZE);