Commit 5f0f56e
mavlink: clamp persisted timestamp at save time too, to prevent +15s drift
The previous fix raised signing.timestamp on load to max(saved+15s, now)
but the save path still persisted whatever signing.timestamp held — and
in a session with no successful send_message (e.g. a child where the
first incoming packet gets rejected and so nothing is forwarded onward),
signing.timestamp stays at the loaded value of saved+15s and gets
written straight back. Each load+save cycle then ratchets the stored
key.timestamp by another 15s ahead of real time. After enough sequential
short-lived sessions the stored value parks far enough in the future
that the next session's first incoming packet is below
signing.timestamp - MAVLINK_SIGNING_TIMESTAMP_LIMIT seconds and the
helper rejects it with MAVLINK_SIGNING_STATUS_OLD_TIMESTAMP. Once that
happens nothing forwards on that link for the lifetime of the test
suite.
Cap the persisted value at current wall clock. The +15s buffer is a
load-time replay guard against advancement lost between the previous
save and a crash; it isn't supposed to round-trip through the next
save. With the cap, the stored key.timestamp tracks real time, the
+15s buffer is reapplied fresh on each load, and per-session drift is
bounded at ~15s — never compounds across sessions.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 1dc0e22 commit 5f0f56e
1 file changed
Lines changed: 24 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
383 | 398 | | |
384 | 399 | | |
385 | 400 | | |
386 | | - | |
387 | | - | |
388 | | - | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
389 | 410 | | |
390 | 411 | | |
391 | 412 | | |
| |||
0 commit comments