Fix pcapng timestamp resolution + imported-session duration

- pcap.py: _parse_tsresol now pads options to a 32-bit boundary
  ((-length) % 4) and uses 2** for the MSB-set (power-of-2) case, so
  nanosecond if_tsresol is read correctly (was defaulting to µs and
  scaling timestamps 1000x)
- database/server: set imported session started/ended from the first/last
  packet timestamps (falling back to wall-clock for synthetic SPB)
- frontend: formatDuration renders hours
- tests: tsresol (ns after padded option, default µs, ns round-trip) and
  session-window/fallback (119 total)
This commit is contained in:
catarrh committed 2026-08-15 02:02:44 +03:00
1 parent 5ba55ac3a9
commit c21b655fe1
5 files changed
+82 -4

No files matched your search

+3 -1
View File
@@ -1031,7 +1031,9 @@ function formatDuration(start, end) {
const s = Math.floor(ms / 1000);
if (s < 60) return s + 's';
const m = Math.floor(s / 60);
return m + 'm ' + (s % 60) + 's';
if (m < 60) return m + 'm ' + (s % 60) + 's';
const h = Math.floor(m / 60);
return h + 'h ' + (m % 60) + 'm';
}
function escapeHtml(str) {