diff options
author | peter <peter@FreeBSD.org> | 1999-06-05 05:35:03 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-06-05 05:35:03 +0000 |
commit | 21732dea0c4943518e727150906d9117775a8a6b (patch) | |
tree | 99f7e98fb0f17e44493e65e48edc712f1686eb56 /sys/nfs/xdr_subs.h | |
parent | 06a6a667a6bf7a90688c9b4f6a3bac0a4f01a1c6 (diff) | |
download | FreeBSD-src-21732dea0c4943518e727150906d9117775a8a6b.zip FreeBSD-src-21732dea0c4943518e727150906d9117775a8a6b.tar.gz |
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
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 ca4d7d3..a77e5cf 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 |