提交 96ed02d4 编写于 作者: R Roi Dayan 提交者: Roland Dreier

IB/iser: Support IPv6 address family

Replace struct sockaddr_in with struct sockaddr which supports both
IPv4 and IPv6, and print using the %pIS format directive.
Signed-off-by: NRoi Dayan <roid@mellanox.com>
Signed-off-by: NOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: NRoland Dreier <roland@purestorage.com>
上级 64aa90f2
...@@ -604,8 +604,7 @@ iscsi_iser_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr, ...@@ -604,8 +604,7 @@ iscsi_iser_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr,
ib_conn->ep = ep; ib_conn->ep = ep;
iser_conn_init(ib_conn); iser_conn_init(ib_conn);
err = iser_connect(ib_conn, NULL, (struct sockaddr_in *)dst_addr, err = iser_connect(ib_conn, NULL, dst_addr, non_blocking);
non_blocking);
if (err) if (err)
return ERR_PTR(err); return ERR_PTR(err);
......
...@@ -448,8 +448,8 @@ int iser_reg_rdma_mem_fastreg(struct iscsi_iser_task *task, ...@@ -448,8 +448,8 @@ int iser_reg_rdma_mem_fastreg(struct iscsi_iser_task *task,
enum iser_data_dir cmd_dir); enum iser_data_dir cmd_dir);
int iser_connect(struct iser_conn *ib_conn, int iser_connect(struct iser_conn *ib_conn,
struct sockaddr_in *src_addr, struct sockaddr *src_addr,
struct sockaddr_in *dst_addr, struct sockaddr *dst_addr,
int non_blocking); int non_blocking);
int iser_reg_page_vec(struct iser_conn *ib_conn, int iser_reg_page_vec(struct iser_conn *ib_conn,
......
...@@ -810,22 +810,19 @@ void iser_conn_init(struct iser_conn *ib_conn) ...@@ -810,22 +810,19 @@ void iser_conn_init(struct iser_conn *ib_conn)
* sleeps until the connection is established or rejected * sleeps until the connection is established or rejected
*/ */
int iser_connect(struct iser_conn *ib_conn, int iser_connect(struct iser_conn *ib_conn,
struct sockaddr_in *src_addr, struct sockaddr *src_addr,
struct sockaddr_in *dst_addr, struct sockaddr *dst_addr,
int non_blocking) int non_blocking)
{ {
struct sockaddr *src, *dst;
int err = 0; int err = 0;
sprintf(ib_conn->name, "%pI4:%d", sprintf(ib_conn->name, "%pISp", dst_addr);
&dst_addr->sin_addr.s_addr, dst_addr->sin_port);
iser_info("connecting to: %s\n", ib_conn->name);
/* the device is known only --after-- address resolution */ /* the device is known only --after-- address resolution */
ib_conn->device = NULL; ib_conn->device = NULL;
iser_info("connecting to: %pI4, port 0x%x\n",
&dst_addr->sin_addr, dst_addr->sin_port);
ib_conn->state = ISER_CONN_PENDING; ib_conn->state = ISER_CONN_PENDING;
ib_conn->cma_id = rdma_create_id(iser_cma_handler, ib_conn->cma_id = rdma_create_id(iser_cma_handler,
...@@ -837,9 +834,7 @@ int iser_connect(struct iser_conn *ib_conn, ...@@ -837,9 +834,7 @@ int iser_connect(struct iser_conn *ib_conn,
goto id_failure; goto id_failure;
} }
src = (struct sockaddr *)src_addr; err = rdma_resolve_addr(ib_conn->cma_id, src_addr, dst_addr, 1000);
dst = (struct sockaddr *)dst_addr;
err = rdma_resolve_addr(ib_conn->cma_id, src, dst, 1000);
if (err) { if (err) {
iser_err("rdma_resolve_addr failed: %d\n", err); iser_err("rdma_resolve_addr failed: %d\n", err);
goto addr_failure; goto addr_failure;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册