diff --git a/TODO b/TODO index dc12eb1..a63990c 100644 --- a/TODO +++ b/TODO @@ -1,23 +1,9 @@ Some features that should be added -* More efficient api for read/write commands where we read/write straight - from the socket into the buffer the application specified instead of as now - we pass the data to a callback and then copy it. - * More scsi marshalling and unmarshalling functions in scsi-lowlevel -* Autoconnect for session faiulures. - When the tcp session fail, try several times to reconnect and relogin. - If successful re-issue any commands that were in flight. - -* Redirects - -* Integrate with other relevant utilities such as +* Integrate with other relevant utilities such as dvdrecord, ... * Data Digest - - - - diff --git a/include/iscsi-private.h b/include/iscsi-private.h index 065f243..3c3a219 100644 --- a/include/iscsi-private.h +++ b/include/iscsi-private.h @@ -82,8 +82,8 @@ struct iscsi_context { void *opaque; enum iscsi_transport_type transport; - char initiator_name[MAX_STRING_SIZE+1]; - char target_name[MAX_STRING_SIZE+1]; + char initiator_name[MAX_ISCSI_NAME_SIZE+1]; + char target_name[MAX_ISCSI_NAME_SIZE+1]; char target_address[MAX_STRING_SIZE+1]; /* If a redirect */ char connected_portal[MAX_STRING_SIZE+1]; char portal[MAX_STRING_SIZE+1]; diff --git a/include/iscsi.h b/include/iscsi.h index 375a7d8..ef9636e 100644 --- a/include/iscsi.h +++ b/include/iscsi.h @@ -44,6 +44,8 @@ struct scsi_iovec; #define LIBISCSI_FEATURE_ISER (1) #define MAX_STRING_SIZE (255) +/* RFC 3720 Section 3.2.6.1 */ +#define MAX_ISCSI_NAME_SIZE (223) /* * Syntax for normal and portal/discovery URLs. diff --git a/lib/init.c b/lib/init.c index 7dc5348..cc5bb42 100644 --- a/lib/init.c +++ b/lib/init.c @@ -222,7 +222,7 @@ iscsi_create_context(const char *initiator_name) return NULL; } - strncpy(iscsi->initiator_name,initiator_name,MAX_STRING_SIZE); + strncpy(iscsi->initiator_name,initiator_name,MAX_ISCSI_NAME_SIZE); iscsi->fd = -1; @@ -386,7 +386,7 @@ iscsi_set_targetname(struct iscsi_context *iscsi, const char *target_name) return -1; } - strncpy(iscsi->target_name,target_name,MAX_STRING_SIZE); + strncpy(iscsi->target_name,target_name,MAX_ISCSI_NAME_SIZE); return 0; }