|
@@ -456,17 +456,18 @@ static int iscsi_build_login_request_strings ( struct iscsi_session *iscsi,
|
456
|
456
|
"InitiatorName=%s%c"
|
457
|
457
|
"TargetName=%s%c"
|
458
|
458
|
"SessionType=Normal%c"
|
459
|
|
- "AuthMethod=CHAP,None%c",
|
|
459
|
+ "AuthMethod=%sNone%c",
|
460
|
460
|
iscsi_initiator_iqn(), 0,
|
461
|
|
- iscsi->target_iqn, 0, 0, 0 );
|
|
461
|
+ iscsi->target_iqn, 0, 0,
|
|
462
|
+ ( ( iscsi->username && iscsi->password ) ?
|
|
463
|
+ "CHAP," : "" ), 0 );
|
462
|
464
|
}
|
463
|
465
|
|
464
|
466
|
if ( iscsi->status & ISCSI_STATUS_STRINGS_CHAP_ALGORITHM ) {
|
465
|
467
|
used += ssnprintf ( data + used, len - used, "CHAP_A=5%c", 0 );
|
466
|
468
|
}
|
467
|
469
|
|
468
|
|
- if ( ( iscsi->status & ISCSI_STATUS_STRINGS_CHAP_RESPONSE ) &&
|
469
|
|
- iscsi->username ) {
|
|
470
|
+ if ( ( iscsi->status & ISCSI_STATUS_STRINGS_CHAP_RESPONSE ) ) {
|
470
|
471
|
used += ssnprintf ( data + used, len - used,
|
471
|
472
|
"CHAP_N=%s%cCHAP_R=0x",
|
472
|
473
|
iscsi->username, 0 );
|