summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2015-08-24 10:26:04 -0700
committerNicholas Bellinger <nab@linux-iscsi.org>2015-08-26 23:27:16 -0700
commit69d755747d31c07a416064f251c2f408938fb67a (patch)
treea3a4e17c1d5ddb6c2e9b5ef62a3ffeb505921058 /drivers/infiniband/ulp
parent76c28f1fcfeb42b47f798fe498351ee1d60086ae (diff)
downloadtalos-op-linux-69d755747d31c07a416064f251c2f408938fb67a.tar.gz
talos-op-linux-69d755747d31c07a416064f251c2f408938fb67a.zip
target/iscsi: Keep local_ip as the actual sockaddr
This is a more natural format that lets us format it with the appropriate printk specifier as needed. This also lets us handle v4-mapped ipv6 addresses a little more nicely, by storing the addr as an actual v4 sockaddr in conn->local_sockaddr. Finally, we no longer need to maintain variables for port, since this is contained in sockaddr. Remove iscsi_np.np_port and iscsi_conn.local_port. Signed-off-by: Andy Grover <agrover@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r--drivers/infiniband/ulp/isert/ib_isert.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 771700963127..9e7094c244ea 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -3218,9 +3218,7 @@ isert_set_conn_info(struct iscsi_np *np, struct iscsi_conn *conn,
conn->login_port = ntohs(sock_in6->sin6_port);
sock_in6 = (struct sockaddr_in6 *)&cm_route->addr.src_addr;
- snprintf(conn->local_ip, sizeof(conn->local_ip), "%pI6c",
- &sock_in6->sin6_addr.in6_u);
- conn->local_port = ntohs(sock_in6->sin6_port);
+ memcpy(&conn->local_sockaddr , &sock_in6, sizeof(sock_in6));
} else {
sock_in = (struct sockaddr_in *)&cm_route->addr.dst_addr;
sprintf(conn->login_ip, "%pI4",
@@ -3228,9 +3226,7 @@ isert_set_conn_info(struct iscsi_np *np, struct iscsi_conn *conn,
conn->login_port = ntohs(sock_in->sin_port);
sock_in = (struct sockaddr_in *)&cm_route->addr.src_addr;
- sprintf(conn->local_ip, "%pI4",
- &sock_in->sin_addr.s_addr);
- conn->local_port = ntohs(sock_in->sin_port);
+ memcpy(&conn->local_sockaddr , &sock_in, sizeof(sock_in));
}
}
OpenPOWER on IntegriCloud