diff options
author | Thomas RIENOESSL <thomas.rienoessl@bachmann.info> | 2023-03-10 10:51:54 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-05-05 17:48:44 -0400 |
commit | 1b6064b3c6422e6e3e32ab641761ebcc0ce9d5c0 (patch) | |
tree | d48a2a3256b892c5685071eee92f6deb3472aaa6 /net | |
parent | 791a43eadbcf5ae5100931e6464702f0050388f8 (diff) | |
download | u-boot-1b6064b3c6422e6e3e32ab641761ebcc0ce9d5c0.zip u-boot-1b6064b3c6422e6e3e32ab641761ebcc0ce9d5c0.tar.gz u-boot-1b6064b3c6422e6e3e32ab641761ebcc0ce9d5c0.tar.bz2 |
nfs: handle rpc errors for mount calls
Signed-off-by: Thomas RIENOESSL <thomas.rienoessl@bachmann.info>
Diffstat (limited to 'net')
-rw-r--r-- | net/nfs.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -524,6 +524,7 @@ static int rpc_lookup_reply(int prog, uchar *pkt, unsigned len) static int nfs_mount_reply(uchar *pkt, unsigned len) { struct rpc_t rpc_pkt; + int ret; debug("%s\n", __func__); @@ -534,11 +535,9 @@ static int nfs_mount_reply(uchar *pkt, unsigned len) else if (ntohl(rpc_pkt.u.reply.id) < rpc_id) return -NFS_RPC_DROP; - if (rpc_pkt.u.reply.rstatus || - rpc_pkt.u.reply.verifier || - rpc_pkt.u.reply.astatus || - rpc_pkt.u.reply.data[0]) - return -1; + ret = rpc_handle_error(&rpc_pkt); + if (ret) + return ret; fs_mounted = 1; /* NFSv2 and NFSv3 use same structure */ @@ -794,6 +793,10 @@ static void nfs_handler(uchar *pkt, unsigned dest, struct in_addr sip, /* just to be sure... */ nfs_state = STATE_UMOUNT_REQ; nfs_send(); + } else if (reply == -NFS_RPC_PROG_MISMATCH && + choosen_nfs_version != NFS_UNKOWN) { + nfs_state = STATE_MOUNT_REQ; + nfs_send(); } else { nfs_state = STATE_LOOKUP_REQ; nfs_send(); |