Add negotiation of IFMarker, OFMarker and MaxConnections during login
This commit is contained in:
+78
@@ -348,6 +348,66 @@ iscsi_login_add_defaulttime2retain(struct iscsi_context *iscsi, struct iscsi_pdu
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
iscsi_login_add_ifmarker(struct iscsi_context *iscsi, struct iscsi_pdu *pdu)
|
||||||
|
{
|
||||||
|
char *str;
|
||||||
|
|
||||||
|
/* We only send IFMarker during opneg */
|
||||||
|
if (iscsi->current_phase != ISCSI_PDU_LOGIN_CSG_OPNEG) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
str = (char *)"IFMarker=No";
|
||||||
|
if (iscsi_pdu_add_data(iscsi, pdu, (unsigned char *)str, strlen(str)+1)
|
||||||
|
!= 0) {
|
||||||
|
iscsi_set_error(iscsi, "Out-of-memory: pdu add data failed.");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
iscsi_login_add_ofmarker(struct iscsi_context *iscsi, struct iscsi_pdu *pdu)
|
||||||
|
{
|
||||||
|
char *str;
|
||||||
|
|
||||||
|
/* We only send OFMarker during opneg */
|
||||||
|
if (iscsi->current_phase != ISCSI_PDU_LOGIN_CSG_OPNEG) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
str = (char *)"OFMarker=No";
|
||||||
|
if (iscsi_pdu_add_data(iscsi, pdu, (unsigned char *)str, strlen(str)+1)
|
||||||
|
!= 0) {
|
||||||
|
iscsi_set_error(iscsi, "Out-of-memory: pdu add data failed.");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
iscsi_login_add_maxconnections(struct iscsi_context *iscsi, struct iscsi_pdu *pdu)
|
||||||
|
{
|
||||||
|
char *str;
|
||||||
|
|
||||||
|
/* We only send MaxConnections during opneg */
|
||||||
|
if (iscsi->current_phase != ISCSI_PDU_LOGIN_CSG_OPNEG) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
str = (char *)"MaxConnections=1";
|
||||||
|
if (iscsi_pdu_add_data(iscsi, pdu, (unsigned char *)str, strlen(str)+1)
|
||||||
|
!= 0) {
|
||||||
|
iscsi_set_error(iscsi, "Out-of-memory: pdu add data failed.");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
iscsi_login_add_maxoutstandingr2t(struct iscsi_context *iscsi, struct iscsi_pdu *pdu)
|
iscsi_login_add_maxoutstandingr2t(struct iscsi_context *iscsi, struct iscsi_pdu *pdu)
|
||||||
{
|
{
|
||||||
@@ -735,6 +795,24 @@ iscsi_login_async(struct iscsi_context *iscsi, iscsi_command_cb cb,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ifmarker */
|
||||||
|
if (iscsi_login_add_ifmarker(iscsi, pdu) != 0) {
|
||||||
|
iscsi_free_pdu(iscsi, pdu);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ofmarker */
|
||||||
|
if (iscsi_login_add_ofmarker(iscsi, pdu) != 0) {
|
||||||
|
iscsi_free_pdu(iscsi, pdu);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* maxconnections */
|
||||||
|
if (iscsi_login_add_maxconnections(iscsi, pdu) != 0) {
|
||||||
|
iscsi_free_pdu(iscsi, pdu);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
/* max recv data segment length */
|
/* max recv data segment length */
|
||||||
if (iscsi_login_add_maxrecvdatasegmentlength(iscsi, pdu) != 0) {
|
if (iscsi_login_add_maxrecvdatasegmentlength(iscsi, pdu) != 0) {
|
||||||
iscsi_free_pdu(iscsi, pdu);
|
iscsi_free_pdu(iscsi, pdu);
|
||||||
|
|||||||
Reference in New Issue
Block a user