lockd: fix the endianness bug
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 13 Apr 2012 17:49:47 +0000 (13:49 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 13 Apr 2012 17:50:52 +0000 (13:50 -0400)
comparing be32 values for < is not doing the right thing...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/lockd/clnt4xdr.c
fs/lockd/clntxdr.c

index 3ddcbb1c0a432728f626986b1d057d11aafdce84..13ad1539fbf2479cd7f69a45611cd3d6a460688f 100644 (file)
@@ -241,7 +241,7 @@ static int decode_nlm4_stat(struct xdr_stream *xdr, __be32 *stat)
        p = xdr_inline_decode(xdr, 4);
        if (unlikely(p == NULL))
                goto out_overflow;
-       if (unlikely(*p > nlm4_failed))
+       if (unlikely(ntohl(*p) > ntohl(nlm4_failed)))
                goto out_bad_xdr;
        *stat = *p;
        return 0;
index 3d35e3e80c1ccfac1367647b6ac417ba3f5bd1b2..d269ada7670e155c7544a2aa01ea0697e98f3991 100644 (file)
@@ -236,7 +236,7 @@ static int decode_nlm_stat(struct xdr_stream *xdr,
        p = xdr_inline_decode(xdr, 4);
        if (unlikely(p == NULL))
                goto out_overflow;
-       if (unlikely(*p > nlm_lck_denied_grace_period))
+       if (unlikely(ntohl(*p) > ntohl(nlm_lck_denied_grace_period)))
                goto out_enum;
        *stat = *p;
        return 0;