-
Notifications
You must be signed in to change notification settings - Fork 61
Description
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.