Skip to content

Commit e847469

Browse files
author
Al Viro
committed
lockd: fix the endianness bug
comparing be32 values for < is not doing the right thing... Signed-off-by: Al Viro <[email protected]>
1 parent 72094e4 commit e847469

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

fs/lockd/clnt4xdr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ static int decode_nlm4_stat(struct xdr_stream *xdr, __be32 *stat)
241241
p = xdr_inline_decode(xdr, 4);
242242
if (unlikely(p == NULL))
243243
goto out_overflow;
244-
if (unlikely(*p > nlm4_failed))
244+
if (unlikely(ntohl(*p) > ntohl(nlm4_failed)))
245245
goto out_bad_xdr;
246246
*stat = *p;
247247
return 0;

fs/lockd/clntxdr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ static int decode_nlm_stat(struct xdr_stream *xdr,
236236
p = xdr_inline_decode(xdr, 4);
237237
if (unlikely(p == NULL))
238238
goto out_overflow;
239-
if (unlikely(*p > nlm_lck_denied_grace_period))
239+
if (unlikely(ntohl(*p) > ntohl(nlm_lck_denied_grace_period)))
240240
goto out_enum;
241241
*stat = *p;
242242
return 0;

0 commit comments

Comments
 (0)