Whamcloud - gitweb
LU-12678 lnet: use lnet_accept_magic, not le32_to_cpu. 57/36857/3
authorMr NeilBrown <neilb@suse.de>
Wed, 6 Nov 2019 05:59:45 +0000 (16:59 +1100)
committerOleg Drokin <green@whamcloud.com>
Fri, 10 Jan 2020 07:42:22 +0000 (07:42 +0000)
This le32_to_cpu() looks wrong, as the argument is a CPU value, not
le32, and the value is being compared to something that might be
le32.  Previous code used lnet_accept_magic() for tests on 'magic',
so it seems to make sense to use lnet_accept_magic() here too.

Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I3f04bb087d4ae3d6785e77072b51132f9440bd32
Reviewed-on: https://review.whamcloud.com/36857
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>

index 232018b..9f1fc51 100644 (file)
@@ -252,7 +252,7 @@ lnet_accept(struct socket *sock, __u32 magic)
                        return -EPROTO;
-               if (magic == le32_to_cpu(LNET_PROTO_TCP_MAGIC))
+               if (lnet_accept_magic(magic, LNET_PROTO_TCP_MAGIC))
                        str = "'old' socknal/tcpnal";
                        str = "unrecognised";