mirror of
https://gitlab.com/d3tn/ud3tn.git
synced 2026-08-17 13:07:35 +02:00
We were taking the current time value in milliseconds and sometimes subtracting larger values from it. This cleans up the calculations to always determine the expiration time as uint64_t and compare it against the current uint64_t timestamp. It further removes the unnecessary "current timestamp" parameter in `bundle_get_expiration_time_s` (we now store the reception time with the bundle, so, do not need this anymore) and avoids a integer wrap-around case in the function. Note that the current time cancels out in the age block-based calculation as we can use the reception timestamp there and offset it by the calculated relative remaining lifetime. Found by Clang's UB sanitizer. Signed-off-by: Felix Walter <felix.walter@d3tn.com> |
||
|---|---|---|
| .. | ||
| bundle6.c | ||
| create.c | ||
| fragment.c | ||
| parser.c | ||
| reports.c | ||
| sdnv.c | ||
| serializer.c | ||