Menu

#44 Send_TimeSyncUTC() does not calculate the right length for datalink_send_pdu().

v0.8.4
closed
None
1
2016-03-30
2016-03-29
Anonymous
No

Send_TimeSyncUTC() does not calculate the right length for datalink_send_pdu().

pdu_len is not added properly resulting in a malformed packet to be sent.

Was introduced with the fix of the following bug:
https://sourceforge.net/p/bacnet/bugs/5/
But, not fixed in:
https://sourceforge.net/p/bacnet/bugs/28/

s_ts.c line 115
...
** pdu_len =
npdu_encode_pdu(&Handler_Transmit_Buffer[0], &dest, &my_address,
&npdu_data);
/ encode the APDU portion of the packet /
** pdu_len =

timesync_utc_encode_apdu(&Handler_Transmit_Buffer[pdu_len], bdate, btime);
bytes_sent =
datalink_send_pdu(&dest, &npdu_data, &Handler_Transmit_Buffer[0],
pdu_len);
...

Thank you

Discussion

  • lo pe

    lo pe - 2016-03-29

    See Send_TimeSync_Remote(), it calculates properly the pdu_length with len.

    Also, to have a fonction Send_TimeSyncUTC_Remote() could be interesting, like we have Send_TimeSync_Remote().

     
  • Steve Karg

    Steve Karg - 2016-03-30
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
     Send_TimeSyncUTC() does not calculate the right length for datalink_send_pdu().
    
     pdu_len is not added properly resulting in a malformed packet to be sent.
    
    • status: open --> closed
     
  • Steve Karg

    Steve Karg - 2016-03-30

    Thank you for reporting the bug.
    Committed fix as r2969, and also fixed in branch releases.

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB