Skip to content

Commit

Permalink
staging: lustre: lnet: use correct 'magic' test
Browse files Browse the repository at this point in the history
Use the lnet_magic_accept() function to compare 'magic' against
LNET_PROTO_TCP_MAGIC for the appropriate string for an error message.

The original fix removed an unneeded byte-ordering cast because the define
was already CPU byte-ordered and it was assumed that 'magic' was CPU
byte-ordered, too.

Now modify the if-statement to use the appropriate lnet_accept_magic()
function in order to be consistent with similar tests. This will allow
the code to be consistent with the general understanding that 'magic'
should be in host-byte-order for the peer that sent the message.

Fixes: 8078292 ("staging: lustre: Fix unneeded byte-ordering cast")
Signed-off-by: Justin Skists <j.skists@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Justin Skists authored and Greg Kroah-Hartman committed Mar 22, 2018
1 parent f65d6eb commit 127aaef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lnet/lnet/acceptor.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ lnet_accept(struct socket *sock, __u32 magic)
return -EPROTO;
}

if (magic == LNET_PROTO_TCP_MAGIC)
if (lnet_accept_magic(magic, LNET_PROTO_TCP_MAGIC))
str = "'old' socknal/tcpnal";
else
str = "unrecognised";
Expand Down

0 comments on commit 127aaef

Please sign in to comment.