<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Mar 21, 2018, at 12:53 PM, Justin Skists <<a href="mailto:j.skists@gmail.com" class="">j.skists@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">Use the lnet_magic_accept() function to compare 'magic' against<br class="">
LNET_PROTO_TCP_MAGIC for the appropriate string for an error message.<br class="">
<br class="">
The original fix removed an unneeded byte-ordering cast because the define<br class="">
was already CPU byte-ordered and it was assumed that 'magic' was CPU<br class="">
byte-ordered, too.<br class="">
<br class="">
Now modify the if-statement to use the appropriate lnet_accept_magic()<br class="">
function in order to be consistent with similar tests. This will allow<br class="">
the code to be consistent with the general understanding that 'magic'<br class="">
should be in host-byte-order for the peer that sent the message.<br class="">
<br class="">
Fixes: 80782927e3aa ("staging: lustre: Fix unneeded byte-ordering cast")<br class="">
Cc: NeilBrown <<a href="mailto:neilb@suse.com" class="">neilb@suse.com</a>><br class="">
Signed-off-by: Justin Skists <<a href="mailto:j.skists@gmail.com" class="">j.skists@gmail.com</a>><br class="">
---<br class="">
drivers/staging/lustre/lnet/lnet/acceptor.c | 2 +-<br class="">
1 file changed, 1 insertion(+), 1 deletion(-)<br class="">
<br class="">
diff --git a/drivers/staging/lustre/lnet/lnet/acceptor.c b/drivers/staging/lustre/lnet/lnet/acceptor.c<br class="">
index 13e981781b9a..5648f17eddc0 100644<br class="">
--- a/drivers/staging/lustre/lnet/lnet/acceptor.c<br class="">
+++ b/drivers/staging/lustre/lnet/lnet/acceptor.c<br class="">
@@ -240,7 +240,7 @@ lnet_accept(struct socket *sock, __u32 magic)<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span><span class="Apple-tab-span" style="white-space:pre"></span><span class="Apple-tab-span" style="white-space:pre"></span>return -EPROTO;<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span><span class="Apple-tab-span" style="white-space:pre"></span>}<br class="">
<br class="">
-<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"></span>if (magic == LNET_PROTO_TCP_MAGIC)<br class="">
+<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"></span>if (lnet_accept_magic(magic, LNET_PROTO_TCP_MAGIC))<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span><span class="Apple-tab-span" style="white-space:pre"></span><span class="Apple-tab-span" style="white-space:pre"></span>str = "'old' socknal/tcpnal";<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span><span class="Apple-tab-span" style="white-space:pre"></span>else<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span><span class="Apple-tab-span" style="white-space:pre"></span><span class="Apple-tab-span" style="white-space:pre"></span>str = "unrecognised";<br class="">
-- <br class="">
2.16.2<br class="">
</div>
</div>
</blockquote>
<div><br class="">
</div>
Reviewed by: Doug Oucharek <<a href="mailto:dougso@me.com" class="">dougso@me.com</a>></div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">
<div class=""><br class="">
_______________________________________________<br class="">
lustre-devel mailing list<br class="">
<a href="mailto:lustre-devel@lists.lustre.org" class="">lustre-devel@lists.lustre.org</a><br class="">
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>