mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Event: Bail on add_missing_remote_network_timestamp without add_network_timestamp
This commit is contained in:
parent
0ab53c75cd
commit
8fc86bb4b6
3 changed files with 17 additions and 0 deletions
|
@ -364,6 +364,14 @@ void EventMgr::InitPostScript() {
|
|||
if ( ! zeek::event_registry->RegisterMetadata(net_ts_val, zeek::base_type(zeek::TYPE_TIME)) )
|
||||
zeek::reporter->FatalError("Failed to register NETWORK_TIMESTAMP metadata");
|
||||
|
||||
// Remove this if there's ever a use-case to not use them together.
|
||||
if ( BifConst::EventMetadata::add_missing_remote_network_timestamp &&
|
||||
! BifConst::EventMetadata::add_network_timestamp )
|
||||
zeek::reporter->FatalError(
|
||||
"Setting EventMetadata::add_missing_remote_network_timestamp is only valid together with "
|
||||
"EventMetadata::add_network_timestamp");
|
||||
|
||||
|
||||
iosource_mgr->Register(this, true, false);
|
||||
}
|
||||
} // namespace zeek
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
fatal error: Setting EventMetadata::add_missing_remote_network_timestamp is only valid together with EventMetadata::add_network_timestamp
|
|
@ -0,0 +1,7 @@
|
|||
# @TEST-DOC: Using add_missing_remote_network_timestamp without add_network_timestamp is an error.
|
||||
#
|
||||
# @TEST-EXEC-FAIL: zeek -b %INPUT
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff .stderr
|
||||
|
||||
redef EventMetadata::add_network_timestamp = F;
|
||||
redef EventMetadata::add_missing_remote_network_timestamp = T;
|
Loading…
Add table
Add a link
Reference in a new issue