hdr->msg.hello.incarnation = cpu_to_le64 (hello->kshm_src_incarnation);
rc = lnet_sock_write(sock, hdr, sizeof(*hdr), lnet_acceptor_timeout());
- if (rc != 0) {
- CNETERR("Error %d sending HELLO hdr to %pI4h/%d\n",
- rc, &conn->ksnc_ipaddr, conn->ksnc_port);
- goto out;
- }
+ if (rc != 0) {
+ CNETERR("Error %d sending HELLO hdr to %pISp\n",
+ rc, &conn->ksnc_peeraddr);
+ goto out;
+ }
if (hello->kshm_nips == 0)
goto out;
}
rc = lnet_sock_write(sock, hello->kshm_ips,
- hello->kshm_nips * sizeof(__u32),
- lnet_acceptor_timeout());
- if (rc != 0) {
- CNETERR("Error %d sending HELLO payload (%d)"
- " to %pI4h/%d\n", rc, hello->kshm_nips,
- &conn->ksnc_ipaddr, conn->ksnc_port);
+ hello->kshm_nips * sizeof(__u32),
+ lnet_acceptor_timeout());
+ if (rc != 0) {
+ CNETERR("Error %d sending HELLO payload (%d) to %pISp\n",
+ rc, hello->kshm_nips,
+ &conn->ksnc_peeraddr);
}
out:
LIBCFS_FREE(hdr, sizeof(*hdr));
rc = lnet_sock_write(sock, hello, offsetof(struct ksock_hello_msg, kshm_ips),
lnet_acceptor_timeout());
- if (rc != 0) {
- CNETERR("Error %d sending HELLO hdr to %pI4h/%d\n",
- rc, &conn->ksnc_ipaddr, conn->ksnc_port);
- return rc;
- }
+ if (rc != 0) {
+ CNETERR("Error %d sending HELLO hdr to %pISp\n",
+ rc, &conn->ksnc_peeraddr);
+ return rc;
+ }
if (hello->kshm_nips == 0)
return 0;
rc = lnet_sock_write(sock, hello->kshm_ips,
- hello->kshm_nips * sizeof(__u32),
- lnet_acceptor_timeout());
- if (rc != 0) {
- CNETERR("Error %d sending HELLO payload (%d)"
- " to %pI4h/%d\n", rc, hello->kshm_nips,
- &conn->ksnc_ipaddr, conn->ksnc_port);
- }
+ hello->kshm_nips * sizeof(__u32),
+ lnet_acceptor_timeout());
+ if (rc != 0) {
+ CNETERR("Error %d sending HELLO payload (%d) to %pISp\n", rc,
+ hello->kshm_nips,
+ &conn->ksnc_peeraddr);
+ }
- return rc;
+ return rc;
}
static int
sizeof(*hdr) - offsetof(struct lnet_hdr, src_nid),
timeout);
if (rc != 0) {
- CERROR("Error %d reading rest of HELLO hdr from %pI4h\n",
- rc, &conn->ksnc_ipaddr);
+ CERROR("Error %d reading rest of HELLO hdr from %pIS\n",
+ rc, &conn->ksnc_peeraddr);
LASSERT(rc < 0 && rc != -EALREADY);
goto out;
}
- /* ...and check we got what we expected */
- if (hdr->type != cpu_to_le32 (LNET_MSG_HELLO)) {
- CERROR ("Expecting a HELLO hdr,"
- " but got type %d from %pI4h\n",
- le32_to_cpu (hdr->type),
- &conn->ksnc_ipaddr);
- rc = -EPROTO;
- goto out;
- }
+ /* ...and check we got what we expected */
+ if (hdr->type != cpu_to_le32 (LNET_MSG_HELLO)) {
+ CERROR("Expecting a HELLO hdr, but got type %d from %pIS\n",
+ le32_to_cpu(hdr->type),
+ &conn->ksnc_peeraddr);
+ rc = -EPROTO;
+ goto out;
+ }
hello->kshm_src_nid = le64_to_cpu (hdr->src_nid);
hello->kshm_src_pid = le32_to_cpu (hdr->src_pid);
sizeof (__u32);
if (hello->kshm_nips > LNET_INTERFACES_NUM) {
- CERROR("Bad nips %d from ip %pI4h\n",
- hello->kshm_nips, &conn->ksnc_ipaddr);
+ CERROR("Bad nips %d from ip %pIS\n",
+ hello->kshm_nips, &conn->ksnc_peeraddr);
rc = -EPROTO;
goto out;
}
rc = lnet_sock_read(sock, hello->kshm_ips,
hello->kshm_nips * sizeof(__u32), timeout);
if (rc != 0) {
- CERROR("Error %d reading IPs from ip %pI4h\n",
- rc, &conn->ksnc_ipaddr);
+ CERROR("Error %d reading IPs from ip %pIS\n",
+ rc, &conn->ksnc_peeraddr);
LASSERT(rc < 0 && rc != -EALREADY);
goto out;
}
hello->kshm_ips[i] = __le32_to_cpu(hello->kshm_ips[i]);
if (hello->kshm_ips[i] == 0) {
- CERROR("Zero IP[%d] from ip %pI4h\n",
- i, &conn->ksnc_ipaddr);
+ CERROR("Zero IP[%d] from ip %pIS\n",
+ i, &conn->ksnc_peeraddr);
rc = -EPROTO;
break;
}
offsetof(struct ksock_hello_msg, kshm_src_nid),
timeout);
if (rc != 0) {
- CERROR("Error %d reading HELLO from %pI4h\n",
- rc, &conn->ksnc_ipaddr);
+ CERROR("Error %d reading HELLO from %pIS\n",
+ rc, &conn->ksnc_peeraddr);
LASSERT(rc < 0 && rc != -EALREADY);
return rc;
}
}
if (hello->kshm_nips > LNET_INTERFACES_NUM) {
- CERROR("Bad nips %d from ip %pI4h\n",
- hello->kshm_nips, &conn->ksnc_ipaddr);
+ CERROR("Bad nips %d from ip %pIS\n",
+ hello->kshm_nips, &conn->ksnc_peeraddr);
return -EPROTO;
}
rc = lnet_sock_read(sock, hello->kshm_ips,
hello->kshm_nips * sizeof(__u32), timeout);
- if (rc != 0) {
- CERROR("Error %d reading IPs from ip %pI4h\n",
- rc, &conn->ksnc_ipaddr);
+ if (rc != 0) {
+ CERROR("Error %d reading IPs from ip %pIS\n",
+ rc, &conn->ksnc_peeraddr);
LASSERT(rc < 0 && rc != -EALREADY);
- return rc;
- }
+ return rc;
+ }
for (i = 0; i < (int) hello->kshm_nips; i++) {
if (conn->ksnc_flip)
__swab32s(&hello->kshm_ips[i]);
- if (hello->kshm_ips[i] == 0) {
- CERROR("Zero IP[%d] from ip %pI4h\n",
- i, &conn->ksnc_ipaddr);
- return -EPROTO;
- }
+ if (hello->kshm_ips[i] == 0) {
+ CERROR("Zero IP[%d] from ip %pIS\n",
+ i, &conn->ksnc_peeraddr);
+ return -EPROTO;
+ }
}
return 0;