You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In j1939_21.py the method _process_tp_dt() accepts out-of-sequence packets.
We had a case where the last X packets of a multi-part message were lost and the first Y packets of the next multi-part message were lost. The j1939_21.py code combined those to multi-part messages creating corrupt output.
Example, consider a multi-part message that is made up of 6 packets.
<packet #1 of 6 received of message A>
<packet #2 of 6 received of message A>
<lost packets 3-6 of message A>
<lost packet 1 of message B>
<packet #2 of 6 of message B received> - _process_tp_dt() appends this packet message A
<packet #3 of 6 of message B received> - _process_tp_dt() appends this packet message A
<packet #4 of 6 of message B received> - _process_tp_dt() appends this packet message A
At this point _process_tp_dt() has received 6 packets and outputs a corrupt result.
I propose we add code to j1939_21.py to check the packet sequence number. If _process_tp_dt() receives any out-of-order packet sequence numbers, it should reject them and reset the _rcv_buffer.
The text was updated successfully, but these errors were encountered:
pmoosman
added a commit
to pmoosman/python-can-j1939
that referenced
this issue
Jan 31, 2024
…nH87#72).
Added a check to j1939_21 for out-of-sequence packets. If an
out-of-sequence packet is received, the packet and the current
buffer is discarded.
In j1939_21.py the method _process_tp_dt() accepts out-of-sequence packets.
We had a case where the last X packets of a multi-part message were lost and the first Y packets of the next multi-part message were lost. The j1939_21.py code combined those to multi-part messages creating corrupt output.
Example, consider a multi-part message that is made up of 6 packets.
<packet #1 of 6 received of message A>
<packet #2 of 6 received of message A>
<lost packets 3-6 of message A>
<lost packet 1 of message B>
<packet #2 of 6 of message B received> - _process_tp_dt() appends this packet message A
<packet #3 of 6 of message B received> - _process_tp_dt() appends this packet message A
<packet #4 of 6 of message B received> - _process_tp_dt() appends this packet message A
At this point _process_tp_dt() has received 6 packets and outputs a corrupt result.
I propose we add code to j1939_21.py to check the packet sequence number. If _process_tp_dt() receives any out-of-order packet sequence numbers, it should reject them and reset the _rcv_buffer.
The text was updated successfully, but these errors were encountered: