Merge pull request #440 from plieven/small_fixes

Small fixes
This commit is contained in:
Ronnie Sahlberg
2025-03-27 09:38:01 +10:00
committed by GitHub
4 changed files with 7 additions and 19 deletions

16
TODO
View File

@@ -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

View File

@@ -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];

View File

@@ -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.

View File

@@ -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;
}