aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Skists <j.skists@gmail.com>2018-03-21 19:53:09 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-22 18:15:35 +0100
commit127aaef460ebb715f22d185db2b4d4149bd91c89 (patch)
tree1d23ed718d1c57abfd1cb38afc79d47165b16861
parentstaging: mt7621-gpio: remove redundant owner assignments of drivers (diff)
staging: lustre: lnet: use correct 'magic' test
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: 80782927e3aa ("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>
-rw-r--r--drivers/staging/lustre/lnet/lnet/acceptor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lnet/lnet/acceptor.c b/drivers/staging/lustre/lnet/lnet/acceptor.c
index 13e981781b9a..5648f17eddc0 100644
--- a/drivers/staging/lustre/lnet/lnet/acceptor.c
+++ b/drivers/staging/lustre/lnet/lnet/acceptor.c
@@ -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";