diff --git a/lib/login.c b/lib/login.c index 17825ca..bd91953 100644 --- a/lib/login.c +++ b/lib/login.c @@ -55,8 +55,9 @@ iscsi_login_add_initiatorname(struct iscsi_context *iscsi, struct iscsi_pdu *pdu char str[MAX_STRING_SIZE+1]; /* We only send InitiatorName during opneg or the first leg of secneg */ - if (iscsi->current_phase != ISCSI_PDU_LOGIN_CSG_OPNEG - && iscsi->secneg_phase != ISCSI_LOGIN_SECNEG_PHASE_OFFER_CHAP) { + if ((iscsi->current_phase != ISCSI_PDU_LOGIN_CSG_OPNEG + && iscsi->secneg_phase != ISCSI_LOGIN_SECNEG_PHASE_OFFER_CHAP) + || iscsi->secneg_phase != ISCSI_LOGIN_SECNEG_PHASE_OFFER_CHAP) { return 0; } @@ -78,8 +79,9 @@ iscsi_login_add_alias(struct iscsi_context *iscsi, struct iscsi_pdu *pdu) char str[MAX_STRING_SIZE+1]; /* We only send InitiatorAlias during opneg or the first leg of secneg */ - if (iscsi->current_phase != ISCSI_PDU_LOGIN_CSG_OPNEG - && iscsi->secneg_phase != ISCSI_LOGIN_SECNEG_PHASE_OFFER_CHAP) { + if ((iscsi->current_phase != ISCSI_PDU_LOGIN_CSG_OPNEG + && iscsi->secneg_phase != ISCSI_LOGIN_SECNEG_PHASE_OFFER_CHAP) + || iscsi->secneg_phase != ISCSI_LOGIN_SECNEG_PHASE_OFFER_CHAP) { return 0; } @@ -102,8 +104,9 @@ iscsi_login_add_targetname(struct iscsi_context *iscsi, struct iscsi_pdu *pdu) char str[MAX_STRING_SIZE+1]; /* We only send TargetName during opneg or the first leg of secneg */ - if (iscsi->current_phase != ISCSI_PDU_LOGIN_CSG_OPNEG - && iscsi->secneg_phase != ISCSI_LOGIN_SECNEG_PHASE_OFFER_CHAP) { + if ((iscsi->current_phase != ISCSI_PDU_LOGIN_CSG_OPNEG + && iscsi->secneg_phase != ISCSI_LOGIN_SECNEG_PHASE_OFFER_CHAP) + || iscsi->secneg_phase != ISCSI_LOGIN_SECNEG_PHASE_OFFER_CHAP) { return 0; } @@ -131,9 +134,10 @@ iscsi_login_add_sessiontype(struct iscsi_context *iscsi, struct iscsi_pdu *pdu) { char str[MAX_STRING_SIZE+1]; - /* We only send TargetName during opneg or the first leg of secneg */ - if (iscsi->current_phase != ISCSI_PDU_LOGIN_CSG_OPNEG - && iscsi->secneg_phase != ISCSI_LOGIN_SECNEG_PHASE_OFFER_CHAP) { + /* We only send SessionType during opneg or the first leg of secneg */ + if ((iscsi->current_phase != ISCSI_PDU_LOGIN_CSG_OPNEG + && iscsi->secneg_phase != ISCSI_LOGIN_SECNEG_PHASE_OFFER_CHAP) + || iscsi->secneg_phase != ISCSI_LOGIN_SECNEG_PHASE_OFFER_CHAP) { return 0; }