diff options
Diffstat (limited to 'drivers/scsi/iscsi_tcp.c')
-rw-r--r-- | drivers/scsi/iscsi_tcp.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c index a669f2d11c31..427af0f24b0f 100644 --- a/drivers/scsi/iscsi_tcp.c +++ b/drivers/scsi/iscsi_tcp.c | |||
@@ -726,13 +726,18 @@ static int iscsi_sw_tcp_conn_get_param(struct iscsi_cls_conn *cls_conn, | |||
726 | switch(param) { | 726 | switch(param) { |
727 | case ISCSI_PARAM_CONN_PORT: | 727 | case ISCSI_PARAM_CONN_PORT: |
728 | case ISCSI_PARAM_CONN_ADDRESS: | 728 | case ISCSI_PARAM_CONN_ADDRESS: |
729 | case ISCSI_PARAM_LOCAL_PORT: | ||
729 | spin_lock_bh(&conn->session->frwd_lock); | 730 | spin_lock_bh(&conn->session->frwd_lock); |
730 | if (!tcp_sw_conn || !tcp_sw_conn->sock) { | 731 | if (!tcp_sw_conn || !tcp_sw_conn->sock) { |
731 | spin_unlock_bh(&conn->session->frwd_lock); | 732 | spin_unlock_bh(&conn->session->frwd_lock); |
732 | return -ENOTCONN; | 733 | return -ENOTCONN; |
733 | } | 734 | } |
734 | rc = kernel_getpeername(tcp_sw_conn->sock, | 735 | if (param == ISCSI_PARAM_LOCAL_PORT) |
735 | (struct sockaddr *)&addr, &len); | 736 | rc = kernel_getsockname(tcp_sw_conn->sock, |
737 | (struct sockaddr *)&addr, &len); | ||
738 | else | ||
739 | rc = kernel_getpeername(tcp_sw_conn->sock, | ||
740 | (struct sockaddr *)&addr, &len); | ||
736 | spin_unlock_bh(&conn->session->frwd_lock); | 741 | spin_unlock_bh(&conn->session->frwd_lock); |
737 | if (rc) | 742 | if (rc) |
738 | return rc; | 743 | return rc; |
@@ -895,6 +900,7 @@ static umode_t iscsi_sw_tcp_attr_is_visible(int param_type, int param) | |||
895 | case ISCSI_PARAM_DATADGST_EN: | 900 | case ISCSI_PARAM_DATADGST_EN: |
896 | case ISCSI_PARAM_CONN_ADDRESS: | 901 | case ISCSI_PARAM_CONN_ADDRESS: |
897 | case ISCSI_PARAM_CONN_PORT: | 902 | case ISCSI_PARAM_CONN_PORT: |
903 | case ISCSI_PARAM_LOCAL_PORT: | ||
898 | case ISCSI_PARAM_EXP_STATSN: | 904 | case ISCSI_PARAM_EXP_STATSN: |
899 | case ISCSI_PARAM_PERSISTENT_ADDRESS: | 905 | case ISCSI_PARAM_PERSISTENT_ADDRESS: |
900 | case ISCSI_PARAM_PERSISTENT_PORT: | 906 | case ISCSI_PARAM_PERSISTENT_PORT: |