pcapng: Sysidg events don't always have timestamps

This commit is contained in:
Gerald Combs 2024-01-12 12:07:48 -08:00
parent a0f5d63515
commit 04bd21b700
1 changed files with 5 additions and 1 deletions

View File

@ -3192,7 +3192,7 @@ pcapng_read_sysdig_event_block(wtap *wth, FILE_T fh, pcapng_block_header_t *bh,
wblock->rec->rec_type = REC_TYPE_SYSCALL;
wblock->rec->rec_header.syscall_header.record_type = bh->block_type;
wblock->rec->presence_flags = WTAP_HAS_TS|WTAP_HAS_CAP_LEN /*|WTAP_HAS_INTERFACE_ID */;
wblock->rec->presence_flags = WTAP_HAS_CAP_LEN /*|WTAP_HAS_INTERFACE_ID */;
wblock->rec->tsprec = WTAP_TSPREC_NSEC;
if (!wtap_read_bytes(fh, &cpu_id, sizeof cpu_id, err, err_info)) {
@ -3248,6 +3248,10 @@ pcapng_read_sysdig_event_block(wtap *wth, FILE_T fh, pcapng_block_header_t *bh,
wblock->rec->rec_header.syscall_header.nparams = nparams;
}
if (ts) {
wblock->rec->presence_flags |= WTAP_HAS_TS;
}
wblock->rec->ts.secs = (time_t) (ts / 1000000000);
wblock->rec->ts.nsecs = (int) (ts % 1000000000);