"(int_part != 0) && (fraction != 0)" matches a value that has both
seconds and seconds fraction set to a non-zero value, hence it leaves
zero seconds (0.123) and exact seconds (123.0) out. This bug originates
in commit
d1b0faed from 2004.
Fix the expression and update a test that, although prints its only
Receiver Timestamp as 0.
000000000, in fact has seconds set to 0 and
seconds fraction set to 2.
int_part=GET_BE_U_4(lspping_com_header->ts_rcvd.int_part);
fraction=GET_BE_U_4(lspping_com_header->ts_rcvd.fraction);
ND_PRINT("Receiver Timestamp: ");
- if ((int_part != 0) && (fraction != 0))
+ if (! (int_part == 0 && fraction == 0))
p_ntp_time(ndo, &lspping_com_header->ts_rcvd);
else
ND_PRINT("no timestamp");
Return Code: unknown (65)
Return Subcode: (0)
Sender Handle: 0x00000023, Sequence: 1
- Sender Timestamp: 3558141471.506155999 (2012-10-02T04:37:51Z) Receiver Timestamp: no timestamp
+ Sender Timestamp: 3558141471.506155999 (2012-10-02T04:37:51Z) Receiver Timestamp: 0.000000000
Target FEC Stack TLV (1), length: 24
Unknown subTLV (17), length: 20
0x0000: 0000 0001 0000 0001 c0a8 0001 c0a8 0001