Whamcloud - gitweb
LU-12678 lnet: use lnet_accept_magic, not le32_to_cpu.
[fs/lustre-release.git] / lnet / lnet / acceptor.c
index 5be1dd8..9f1fc51 100644 (file)
@@ -159,7 +159,7 @@ lnet_connect(struct socket **sockp, lnet_nid_t peer_nid,
        int                     port;
        int                     fatal;
 
-       CLASSERT(sizeof(cr) <= 16);             /* not too big to be on the stack */
+       BUILD_BUG_ON(sizeof(cr) > 16); /* not too big to be on the stack */
 
        for (port = LNET_ACCEPTOR_MAX_RESERVED_PORT;
             port >= LNET_ACCEPTOR_MIN_RESERVED_PORT;
@@ -175,7 +175,7 @@ lnet_connect(struct socket **sockp, lnet_nid_t peer_nid,
                        continue;
                }
 
-               CLASSERT(LNET_PROTO_ACCEPTOR_VERSION == 1);
+               BUILD_BUG_ON(LNET_PROTO_ACCEPTOR_VERSION != 1);
 
                cr.acr_magic   = LNET_PROTO_ACCEPTOR_MAGIC;
                cr.acr_version = LNET_PROTO_ACCEPTOR_VERSION;
@@ -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";
                else
                        str = "unrecognised";