diff options
author | Peter Wemm <peter@FreeBSD.org> | 1999-06-05 05:35:03 +0000 |
---|---|---|
committer | Peter Wemm <peter@FreeBSD.org> | 1999-06-05 05:35:03 +0000 |
commit | b903b04cc0511b36869b0b6a59691517c59244fe (patch) | |
tree | ab674779bb261280261b29a88de9bcc2fd4e0c84 /sys/nfs/xdr_subs.h | |
parent | ba68ee9642fa07fee18a2048e53ed9b5ef96f440 (diff) | |
download | src-b903b04cc0511b36869b0b6a59691517c59244fe.tar.gz src-b903b04cc0511b36869b0b6a59691517c59244fe.zip |
Various changes lifted from the OpenBSD cvs tree:
txdr_hyper and fxdr_hyper tweaks to avoid excessive CPU order knowledge.
nfs_serv.c: don't call nfsm_adj() with negative values, windows clients
could crash servers when doing a readdir of a large directory.
nfs_socket.c: Use IP_PORTRANGE to get a priviliged port without a spin
loop trying to bind(). Don't clobber a mbuf pointer or we get panics
on a NFS3ERR_JUKEBOX error from a server when reusing a freed mbuf.
nfs_subs.c: Don't loose st_blocks on NFSv2 mounts when > 2GB.
Obtained from: OpenBSD
Notes
Notes:
svn path=/head/; revision=47751
Diffstat (limited to 'sys/nfs/xdr_subs.h')
-rw-r--r-- | sys/nfs/xdr_subs.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/nfs/xdr_subs.h b/sys/nfs/xdr_subs.h index ca4d7d335bbf..a77e5cf39d50 100644 --- a/sys/nfs/xdr_subs.h +++ b/sys/nfs/xdr_subs.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)xdr_subs.h 8.3 (Berkeley) 3/30/95 - * $Id: xdr_subs.h,v 1.9 1997/02/22 09:42:53 peter Exp $ + * $Id: xdr_subs.h,v 1.10 1998/05/31 20:09:01 peter Exp $ */ @@ -79,13 +79,12 @@ ((struct nfsv3_time *)(t))->nfsv3_nsec = htonl((f)->tv_nsec); \ } -#define fxdr_hyper(f, t) { \ - ((int32_t *)(t))[_QUAD_HIGHWORD] = ntohl(((int32_t *)(f))[0]); \ - ((int32_t *)(t))[_QUAD_LOWWORD] = ntohl(((int32_t *)(f))[1]); \ -} +#define fxdr_hyper(f) \ + ((((u_quad_t)ntohl(((u_int32_t *)(f))[0])) << 32) | \ + (u_quad_t)(ntohl(((u_int32_t *)(f))[1]))) #define txdr_hyper(f, t) { \ - ((int32_t *)(t))[0] = htonl(((int32_t *)(f))[_QUAD_HIGHWORD]); \ - ((int32_t *)(t))[1] = htonl(((int32_t *)(f))[_QUAD_LOWWORD]); \ + ((u_int32_t *)(t))[0] = htonl((u_int32_t)((f) >> 32)); \ + ((u_int32_t *)(t))[1] = htonl((u_int32_t)((f) & 0xffffffff)); \ } #endif |