From d404e581755c1f9b0923e089fe63ce79476d6e14 Mon Sep 17 00:00:00 2001 From: Adheer Chandravanshi Date: Fri, 22 Nov 2013 05:28:21 -0500 Subject: [PATCH] [SCSI] libiscsi: Add local_ipaddr parameter in iscsi_conn struct Add local_ipaddr param and support get/set operations on it. Signed-off-by: Adheer Chandravanshi Signed-off-by: Vikas Chaudhary Reviewed-by: Mike Christie Signed-off-by: James Bottomley --- drivers/scsi/libiscsi.c | 6 ++++++ include/scsi/libiscsi.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index e3995612ea76..40462415291e 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c @@ -2945,6 +2945,7 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn) free_pages((unsigned long) conn->data, get_order(ISCSI_DEF_MAX_RECV_SEG_LEN)); kfree(conn->persistent_address); + kfree(conn->local_ipaddr); kfifo_in(&session->cmdpool.queue, (void*)&conn->login_task, sizeof(void*)); if (session->leadconn == conn) @@ -3269,6 +3270,8 @@ int iscsi_set_param(struct iscsi_cls_conn *cls_conn, sscanf(buf, "%d", &val); session->discovery_sess = !!val; break; + case ISCSI_PARAM_LOCAL_IPADDR: + return iscsi_switch_str_param(&conn->local_ipaddr, buf); default: return -ENOSYS; } @@ -3542,6 +3545,9 @@ int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn, case ISCSI_PARAM_TCP_RECV_WSF: len = sprintf(buf, "%u\n", conn->tcp_recv_wsf); break; + case ISCSI_PARAM_LOCAL_IPADDR: + len = sprintf(buf, "%s\n", conn->local_ipaddr); + break; default: return -ENOSYS; } diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index 6ac9e17acdc4..309f51336fb9 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h @@ -231,6 +231,7 @@ struct iscsi_conn { uint8_t ipv6_traffic_class; uint8_t ipv6_flow_label; uint8_t is_fw_assigned_ipv6; + char *local_ipaddr; /* MIB-statistics */ uint64_t txdata_octets; -- 2.39.5