--- usr/netlink.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/usr/netlink.c b/usr/netlink.c index 1a0bf80..c474375 100644 --- a/usr/netlink.c +++ b/usr/netlink.c @@ -848,10 +848,13 @@ krecv_pdu_end(struct iscsi_conn *conn) int ktransport_ep_connect(iscsi_conn_t *conn, int non_blocking) { - int rc, addrlen; + int rc, addrlen = sizeof(struct sockaddr_storage); struct iscsi_uevent *ev; - struct sockaddr *dst_addr = (struct sockaddr *)&conn->saddr; + struct sockaddr_storage *dst_addr = (struct sockaddr_storage *)&conn->saddr; struct iovec iov[2]; + struct iscsi_session *tmp_session = (struct iscsi_session *)conn->session; + node_rec_t *tmp_rec = (node_rec_t *)&tmp_session->nrec; + iface_rec_t *tmp_iface = (iface_rec_t *)&tmp_rec->iface; log_debug(7, "in %s", __FUNCTION__); @@ -868,19 +871,16 @@ ktransport_ep_connect(iscsi_conn_t *conn, int non_blocking) ev->u.ep_connect.non_blocking = non_blocking; } - if (dst_addr->sa_family == PF_INET) - addrlen = sizeof(struct sockaddr_in); - else if (dst_addr->sa_family == PF_INET6) - addrlen = sizeof(struct sockaddr_in6); - else { + if (dst_addr->ss_family != AF_INET && dst_addr->ss_family != AF_INET6) { log_error("%s unknown addr family %d", - __FUNCTION__, dst_addr->sa_family); + __FUNCTION__, dst_addr->ss_family); return -EINVAL; } memcpy(setparam_buf + sizeof(*ev), dst_addr, addrlen); + iface_copy(setparam_buf + sizeof(*ev) + addrlen, tmp_iface); iov[1].iov_base = ev; - iov[1].iov_len = sizeof(*ev) + addrlen; + iov[1].iov_len = sizeof(*ev) + addrlen + sizeof(iface_rec_t); rc = __kipc_call(iov, 2); if (rc < 0) return rc; -- 2.11.0 -- You received this message because you are subscribed to the Google Groups "open-iscsi" group. To unsubscribe from this group and stop receiving emails from it, send an email to open-iscsi+unsubscr...@googlegroups.com. To post to this group, send email to open-iscsi@googlegroups.com. Visit this group at https://groups.google.com/group/open-iscsi. For more options, visit https://groups.google.com/d/optout.