Whamcloud - gitweb
LU-13950 lnet: do not crash if lnet_sock_getaddr returns error
[fs/lustre-release.git] / lnet / lnet / acceptor.c
index aa8d2e3..f287ae6 100644 (file)
@@ -205,7 +205,10 @@ lnet_accept(struct socket *sock, __u32 magic)
        LASSERT(sizeof(cr) <= 16);              /* not too big for the stack */
 
        rc = lnet_sock_getaddr(sock, true, &peer);
-       LASSERT(rc == 0);                       /* we succeeded before */
+       if (rc != 0) {
+               CERROR("Can't determine new connection's address\n");
+               return rc;
+       }
 
        if (!lnet_accept_magic(magic, LNET_PROTO_ACCEPTOR_MAGIC)) {