Corrected missing packet initialization in DLMSTP for several ports that may result in unusual REPLY-POSTPONED frames emitted for a DATA-EXPECTING-REPLY frame.
This commit is contained in:
@@ -1090,13 +1090,14 @@ static bool MSTP_Master_Node_FSM(
|
|||||||
/* BACnet Data Expecting Reply, a Test_Request, or */
|
/* BACnet Data Expecting Reply, a Test_Request, or */
|
||||||
/* a proprietary frame that expects a reply is received. */
|
/* a proprietary frame that expects a reply is received. */
|
||||||
case MSTP_MASTER_STATE_ANSWER_DATA_REQUEST:
|
case MSTP_MASTER_STATE_ANSWER_DATA_REQUEST:
|
||||||
matched = false;
|
pkt = (struct mstp_pdu_packet *) Ringbuf_Get_Front(&PDU_Queue);
|
||||||
if (!Ringbuf_Empty(&PDU_Queue)) {
|
if (pkt != NULL) {
|
||||||
pkt = (struct mstp_pdu_packet *) Ringbuf_Get_Front(&PDU_Queue);
|
|
||||||
matched =
|
matched =
|
||||||
dlmstp_compare_data_expecting_reply(&InputBuffer[0],
|
dlmstp_compare_data_expecting_reply(&InputBuffer[0],
|
||||||
DataLength, SourceAddress, &pkt->buffer[0], pkt->length,
|
DataLength, SourceAddress, &pkt->buffer[0], pkt->length,
|
||||||
pkt->destination_mac);
|
pkt->destination_mac);
|
||||||
|
} else {
|
||||||
|
matched = false;
|
||||||
}
|
}
|
||||||
if (matched) {
|
if (matched) {
|
||||||
/* Reply */
|
/* Reply */
|
||||||
|
|||||||
@@ -1117,13 +1117,14 @@ static bool MSTP_Master_Node_FSM(
|
|||||||
/* BACnet Data Expecting Reply, a Test_Request, or */
|
/* BACnet Data Expecting Reply, a Test_Request, or */
|
||||||
/* a proprietary frame that expects a reply is received. */
|
/* a proprietary frame that expects a reply is received. */
|
||||||
case MSTP_MASTER_STATE_ANSWER_DATA_REQUEST:
|
case MSTP_MASTER_STATE_ANSWER_DATA_REQUEST:
|
||||||
matched = false;
|
pkt = (struct mstp_pdu_packet *) Ringbuf_Get_Front(&PDU_Queue);
|
||||||
if (!Ringbuf_Empty(&PDU_Queue)) {
|
if (pkt != NULL) {
|
||||||
pkt = (struct mstp_pdu_packet *) Ringbuf_Get_Front(&PDU_Queue);
|
|
||||||
matched =
|
matched =
|
||||||
dlmstp_compare_data_expecting_reply(&InputBuffer[0],
|
dlmstp_compare_data_expecting_reply(&InputBuffer[0],
|
||||||
DataLength, SourceAddress, &pkt->buffer[0], pkt->length,
|
DataLength, SourceAddress, &pkt->buffer[0], pkt->length,
|
||||||
pkt->destination_mac);
|
pkt->destination_mac);
|
||||||
|
} else {
|
||||||
|
matched = false;
|
||||||
}
|
}
|
||||||
if (matched) {
|
if (matched) {
|
||||||
/* Reply */
|
/* Reply */
|
||||||
|
|||||||
@@ -1206,13 +1206,14 @@ static bool MSTP_Master_Node_FSM(
|
|||||||
/* BACnet Data Expecting Reply, a Test_Request, or */
|
/* BACnet Data Expecting Reply, a Test_Request, or */
|
||||||
/* a proprietary frame that expects a reply is received. */
|
/* a proprietary frame that expects a reply is received. */
|
||||||
case MSTP_MASTER_STATE_ANSWER_DATA_REQUEST:
|
case MSTP_MASTER_STATE_ANSWER_DATA_REQUEST:
|
||||||
matched = false;
|
pkt = (struct mstp_pdu_packet *) Ringbuf_Get_Front(&PDU_Queue);
|
||||||
if (!Ringbuf_Empty(&PDU_Queue)) {
|
if (pkt != NULL) {
|
||||||
pkt = (struct mstp_pdu_packet *) Ringbuf_Get_Front(&PDU_Queue);
|
|
||||||
matched =
|
matched =
|
||||||
dlmstp_compare_data_expecting_reply(&InputBuffer[0],
|
dlmstp_compare_data_expecting_reply(&InputBuffer[0],
|
||||||
DataLength, SourceAddress, &pkt->buffer[0], pkt->length,
|
DataLength, SourceAddress, &pkt->buffer[0], pkt->length,
|
||||||
pkt->destination_mac);
|
pkt->destination_mac);
|
||||||
|
} else {
|
||||||
|
matched = false;
|
||||||
}
|
}
|
||||||
if (matched) {
|
if (matched) {
|
||||||
/* Reply */
|
/* Reply */
|
||||||
|
|||||||
Reference in New Issue
Block a user