Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 06 Mar 2000 12:12:19 -0500
From:      "David E. Cross" <crossd@cs.rpi.edu>
To:        freebsd-hackers@freebsd.org, freebsd-current@freebsd.org
Cc:        crossd@cs.rpi.edu
Subject:   rpc.lockd and xdr.
Message-ID:  <200003061712.MAA40849@cs.rpi.edu>

next in thread | raw e-mail | index | archive | help
Version 2 of the lock manager is ready to be released.  Amitha
says that it passes all of the tests in the suite posted by Drew (thanks
Drew).  A noteable exception to this is on SGI where some lock requests
are never even received from the remote host.  Also DOS sharing is not
yet complete.

On a side note, it would appear that at least some of the problems of the
previous version were in FreeBSD's XDR library.  The xdr_*_int64 routines
do not correctly do network byte order conversions.  Included below is
Amitha's 'hack fix'.

====
My hack fix (this is to /usr/src/lib/libc/xdr/xdr.c) is below. A similar
fix needs to be applied to xdr_int64_t. Note that xdr_opaque takes care of
swapping the bits in the byte.

#define SWAP(a,b,t) t=a;a=b;b=t

bool_t
my_xdr_u_int64_t(xdrs, uint64_p)
        register XDR *xdrs;
        u_int64_t *uint64_p;
{
        u_int64_t x;
        unsigned char* b= &x;
        unsigned char t;

        switch (xdrs->x_op) {

        case XDR_ENCODE:
                SWAP(b[0], b[7], t);
                SWAP(b[1], b[6], t);
                SWAP(b[2], b[5], t);
                SWAP(b[3], b[4], t);
                return (xdr_opaque(xdrs, (caddr_t)uint64_p, sizeof(u_int64_t)))
;

        case XDR_DECODE:
                if (!xdr_opaque(xdrs, (caddr_t)&x, sizeof x)) {
                        return (FALSE);
                }
                SWAP(b[0], b[7], t);
                SWAP(b[1], b[6], t);
                SWAP(b[2], b[5], t);
                SWAP(b[3], b[4], t);
                *uint64_p = x;
                return (TRUE);

        case XDR_FREE:
                return (TRUE);
        }
        return (FALSE);
}

=====

--
David Cross                               | email: crossd@cs.rpi.edu 
Acting Lab Director                       | NYSLP: FREEBSD
Systems Administrator/Research Programmer | Web: http://www.cs.rpi.edu/~crossd 
Rensselaer Polytechnic Institute,         | Ph: 518.276.2860            
Department of Computer Science            | Fax: 518.276.4033
I speak only for myself.                  | WinNT:Linux::Linux:FreeBSD


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200003061712.MAA40849>