Skip to content

Commit

Permalink
lockd: fix the endianness bug
Browse files Browse the repository at this point in the history
comparing be32 values for < is not doing the right thing...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Apr 13, 2012
1 parent 72094e4 commit e847469
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fs/lockd/clnt4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion fs/lockd/clntxdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e847469

Please sign in to comment.