diff options
author | Ralf Hubert <r.hubert@technisat.de> | 2016-07-01 13:19:51 +0200 |
---|---|---|
committer | Joe Hershberger <joe.hershberger@ni.com> | 2016-07-06 10:45:07 -0500 |
commit | e4ead4a21db266c84051279ed4ceeab72981df8c (patch) | |
tree | 699d1f990219b94b4bbcb28142df3f2ffa68baee /net | |
parent | 19c9ddaa4f41f6f0bc5cf2991f24fc178c6e56ed (diff) | |
download | u-boot-midas-e4ead4a21db266c84051279ed4ceeab72981df8c.tar.gz u-boot-midas-e4ead4a21db266c84051279ed4ceeab72981df8c.tar.bz2 u-boot-midas-e4ead4a21db266c84051279ed4ceeab72981df8c.zip |
net: Fix incorrect RPC packets on 64-bit systems
This patch fixes incorrect RPC packet layout caused by
'long' type size difference on 64 and 32-bit architectures.
Signed-off-by: Ralf Hubert <r.hubert@technisat.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/nfs.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -132,7 +132,7 @@ static char *dirname(char *path) /************************************************************************** RPC_ADD_CREDENTIALS - Add RPC authentication/verifier entries **************************************************************************/ -static long *rpc_add_credentials(long *p) +static uint32_t *rpc_add_credentials(uint32_t *p) { int hl; int hostnamelen; @@ -241,7 +241,7 @@ static void nfs_mount_req(char *path) pathlen = strlen(path); p = &(data[0]); - p = (uint32_t *)rpc_add_credentials((long *)p); + p = rpc_add_credentials(p); *p++ = htonl(pathlen); if (pathlen & 3) @@ -268,7 +268,7 @@ static void nfs_umountall_req(void) return; p = &(data[0]); - p = (uint32_t *)rpc_add_credentials((long *)p); + p = rpc_add_credentials(p); len = (uint32_t *)p - (uint32_t *)&(data[0]); @@ -289,7 +289,7 @@ static void nfs_readlink_req(void) int len; p = &(data[0]); - p = (uint32_t *)rpc_add_credentials((long *)p); + p = rpc_add_credentials(p); memcpy(p, filefh, NFS_FHSIZE); p += (NFS_FHSIZE / 4); @@ -312,7 +312,7 @@ static void nfs_lookup_req(char *fname) fnamelen = strlen(fname); p = &(data[0]); - p = (uint32_t *)rpc_add_credentials((long *)p); + p = rpc_add_credentials(p); memcpy(p, dirfh, NFS_FHSIZE); p += (NFS_FHSIZE / 4); @@ -337,7 +337,7 @@ static void nfs_read_req(int offset, int readlen) int len; p = &(data[0]); - p = (uint32_t *)rpc_add_credentials((long *)p); + p = rpc_add_credentials(p); memcpy(p, filefh, NFS_FHSIZE); p += (NFS_FHSIZE / 4); |