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:
skarg
2011-12-29 03:37:38 +00:00
parent ef40b6e180
commit ad74c6d4ac
3 changed files with 12 additions and 9 deletions
+4 -3
View File
@@ -1090,13 +1090,14 @@ static bool MSTP_Master_Node_FSM(
/* BACnet Data Expecting Reply, a Test_Request, or */
/* a proprietary frame that expects a reply is received. */
case MSTP_MASTER_STATE_ANSWER_DATA_REQUEST:
matched = false;
if (!Ringbuf_Empty(&PDU_Queue)) {
pkt = (struct mstp_pdu_packet *) Ringbuf_Get_Front(&PDU_Queue);
pkt = (struct mstp_pdu_packet *) Ringbuf_Get_Front(&PDU_Queue);
if (pkt != NULL) {
matched =
dlmstp_compare_data_expecting_reply(&InputBuffer[0],
DataLength, SourceAddress, &pkt->buffer[0], pkt->length,
pkt->destination_mac);
} else {
matched = false;
}
if (matched) {
/* Reply */
+4 -3
View File
@@ -1117,13 +1117,14 @@ static bool MSTP_Master_Node_FSM(
/* BACnet Data Expecting Reply, a Test_Request, or */
/* a proprietary frame that expects a reply is received. */
case MSTP_MASTER_STATE_ANSWER_DATA_REQUEST:
matched = false;
if (!Ringbuf_Empty(&PDU_Queue)) {
pkt = (struct mstp_pdu_packet *) Ringbuf_Get_Front(&PDU_Queue);
pkt = (struct mstp_pdu_packet *) Ringbuf_Get_Front(&PDU_Queue);
if (pkt != NULL) {
matched =
dlmstp_compare_data_expecting_reply(&InputBuffer[0],
DataLength, SourceAddress, &pkt->buffer[0], pkt->length,
pkt->destination_mac);
} else {
matched = false;
}
if (matched) {
/* Reply */
+4 -3
View File
@@ -1206,13 +1206,14 @@ static bool MSTP_Master_Node_FSM(
/* BACnet Data Expecting Reply, a Test_Request, or */
/* a proprietary frame that expects a reply is received. */
case MSTP_MASTER_STATE_ANSWER_DATA_REQUEST:
matched = false;
if (!Ringbuf_Empty(&PDU_Queue)) {
pkt = (struct mstp_pdu_packet *) Ringbuf_Get_Front(&PDU_Queue);
pkt = (struct mstp_pdu_packet *) Ringbuf_Get_Front(&PDU_Queue);
if (pkt != NULL) {
matched =
dlmstp_compare_data_expecting_reply(&InputBuffer[0],
DataLength, SourceAddress, &pkt->buffer[0], pkt->length,
pkt->destination_mac);
} else {
matched = false;
}
if (matched) {
/* Reply */