feat: allow targetname redirect

this patch adds an non-RFC extenstion to the redirect login response which allows
a target to temporarily redirect not only to a different target address but also to
a different targetname.

This is needed to allow scenarious in active/active storage clusters where each
node had its own targetname, but maps the same volumes behind equal LUN ids.

For this non-RFC behaviour the environment variable LIBISCSI_ALLLOW_TARGETNAME_REDIRECT
has to be set.

Signed-off-by: Peter Lieven <pl@dlhnet.de>
This commit is contained in:
Peter Lieven
2025-09-11 19:51:00 +00:00
parent 2b2529d196
commit 247133c9e2
2 changed files with 29 additions and 13 deletions

View File

@@ -112,13 +112,14 @@ struct iscsi_context {
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 target_name2[MAX_ISCSI_NAME_SIZE+1]; /* If a redirect */
char connected_portal[MAX_STRING_SIZE+1];
char portal[MAX_STRING_SIZE+1];
char alias[MAX_STRING_SIZE+1];
char bind_interfaces[MAX_STRING_SIZE+1];
char unit_serial_number[MAX_STRING_SIZE+1];
enum iscsi_chap_auth chap_auth;
enum iscsi_chap_auth chap_auth;
char user[MAX_STRING_SIZE+1];
char passwd[MAX_STRING_SIZE+1];
char chap_c[MAX_CHAP_C_LENGTH+1];