Re: [PATCH 1/2] iscsi-tools: Add support to display CHAP list and delete

2012-03-06 Thread Mike Christie
I merged the second patch with no issue.

This patch had lots of little bugs. I fixed them when I merged it. Just
watch out next time.



On 02/27/2012 06:10 AM, vikas.chaudh...@qlogic.com wrote:
 From: Nilesh Javali nilesh.jav...@qlogic.com
 
 Signed-off-by: Nilesh Javali nilesh.jav...@qlogic.com
 Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
 ---
  include/iscsi_if.h |   33 +++-
  usr/host.h |3 ++
  usr/idbm.c |   25 +
  usr/idbm.h |3 ++
  usr/idbm_fields.h  |7 +++
  usr/iscsi_ipc.h|7 +++
  usr/iscsiadm.c |  153 
 ++--
  usr/netlink.c  |   80 +++
  8 files changed, 307 insertions(+), 4 deletions(-)
 
 diff --git a/include/iscsi_if.h b/include/iscsi_if.h
 index 26182aa..9866864 100644
 --- a/include/iscsi_if.h
 +++ b/include/iscsi_if.h
 @@ -66,8 +66,10 @@ enum iscsi_uevent_e {
 +struct iscsi_chap_rec {
 + uint16_t chap_tbl_idx;
 + enum chap_type_e chap_type;
 + char username[ISCSI_CHAP_AUTH_NAME_MAX_LEN];
 + uint8_t password[ISCSI_CHAP_AUTH_SECRET_MAX_LEN];
 + uint8_t password_length;
 +} __attribute__((__packed__));
 +
 +


I removed patched, because it is not needed. Please send the kernel
patch upstream for this with your ping status changes.


  }
  
 +int get_chap_info(uint32_t host_no)
 +{
 + struct iscsi_transport *t = NULL;
 + struct iscsi_chap_rec *crec = NULL;
 + char *req_buf = NULL;
 + uint32_t valid_chap_entries;
 + uint32_t num_entries;
 + uint16_t chap_tbl_idx = 0;
 + int rc = 0;
 + int fd, i = 0;
 +
 + t = iscsi_sysfs_get_transport_by_hba(host_no);
 + if (!t) {
 + log_error(Could not match hostno %d to 
 +   transport., host_no);


no error code returned. This happened a lot in this patch.


 +
 +static int delete_chap_info(uint32_t host_no, char *value)
 +{
 + struct iscsi_transport *t = NULL;
 + int fd, rc = 0;
 + uint16_t chap_tbl_idx;
 +
 + chap_tbl_idx = (uint16_t)atoi(value);


There is not validation for this. You could segfault due to NULL pointer.

-- 
You received this message because you are subscribed to the Google Groups 
open-iscsi group.
To post to this group, send email to open-iscsi@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.



Re: [PATCH 1/2] iscsi-tools: Add support to display CHAP list and delete

2012-03-05 Thread Mike Christie
On 02/27/2012 06:10 AM, vikas.chaudh...@qlogic.com wrote:
 +/* chap fields */
 +#define CHAP_INDEX   chap.chap_tbl_idx
 +#define CHAP_USERNAMEchap.username
 +#define CHAP_PASSWORDchap.password
 +#define CHAP_PASSWORD_LENchap.password_length
 +#define CHAP_TYPEchap.chap_type
 +

Currently we have:

node.session.auth.username
node.session.auth.password
node.session.auth.username_in
node.session.auth.password_in

discovery.sendtargets.auth.username
discovery.sendtargets.auth.password
discovery.sendtargets.auth.username_in
discovery.sendtargets.auth.password_in

So the print code should display it in a similar way. For example
instead of printing out chap_type it should use the proper setting from
above. I will fix that up when merging.

My question, how does the card handle discovery vs normal session chap
settings. Are they all in the same table, or should they be separated
like above.

If they are all in the same table and are host global then maybe
renaming the ones you were adding to

host.auth.username
host.auth.password
host.auth.username_in
host.auth.password_in

is going to be a better fit for how we currently name things?

-- 
You received this message because you are subscribed to the Google Groups 
open-iscsi group.
To post to this group, send email to open-iscsi@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.



Re: [PATCH 1/2] iscsi-tools: Add support to display CHAP list and delete

2012-03-05 Thread Vikas Chaudhary


-Original Message-
From: Mike Christie micha...@cs.wisc.edu
Date: Mon, 5 Mar 2012 03:42:13 -0800
To: open-iscsi@googlegroups.com open-iscsi@googlegroups.com
Cc: Vikas Chaudhary vikas.chaudh...@qlogic.com, Lalit Chandivade
lalit.chandiv...@qlogic.com, Ravi Anand ravi.an...@qlogic.com, Nilesh
Javali nilesh.jav...@qlogic.com
Subject: Re: [PATCH 1/2] iscsi-tools: Add support to display CHAP list and
delete

On 02/27/2012 06:10 AM, vikas.chaudh...@qlogic.com wrote:
 +/* chap fields */
 +#define CHAP_INDEX  chap.chap_tbl_idx
 +#define CHAP_USERNAME   chap.username
 +#define CHAP_PASSWORD   chap.password
 +#define CHAP_PASSWORD_LEN   chap.password_length
 +#define CHAP_TYPE   chap.chap_type
 +

Currently we have:

node.session.auth.username
node.session.auth.password
node.session.auth.username_in
node.session.auth.password_in

discovery.sendtargets.auth.username
discovery.sendtargets.auth.password
discovery.sendtargets.auth.username_in
discovery.sendtargets.auth.password_in

So the print code should display it in a similar way. For example
instead of printing out chap_type it should use the proper setting from
above. I will fix that up when merging.

My question, how does the card handle discovery vs normal session chap
settings. Are they all in the same table, or should they be separated
like above.

They are all in same table and they are host global.


If they are all in the same table and are host global then maybe
renaming the ones you were adding to

host.auth.username
host.auth.password
host.auth.username_in
host.auth.password_in

is going to be a better fit for how we currently name things?


Yes, Looks better.


This message and any attached documents contain information from QLogic 
Corporation or its wholly-owned subsidiaries that may be confidential. If you 
are not the intended recipient, you may not read, copy, distribute, or use this 
information. If you have received this transmission in error, please notify the 
sender immediately by reply e-mail and then delete this message.

-- 
You received this message because you are subscribed to the Google Groups 
open-iscsi group.
To post to this group, send email to open-iscsi@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.