Commit graph

19654 commits

Author SHA1 Message Date
Arne Welzel
b5d17f7f49 ZAM: Drop some unneeded DeleteManagedTyped() calls
The delete happens by assigning to a slot now. Seems the * and ->
operators added to ZValElement correctly works with the remaining
usages for RawOptField() and RawField().
2025-10-09 10:48:02 +02:00
Arne Welzel
714bcd78c8 RecordVal: Replace std::vector with ZValSlot[]
A std::vector is 24 bytes, while num_fields + unique_ptr ends up 16
bytes, bringing RecordVal instances down to 64 bytes.
2025-10-09 10:48:02 +02:00
Arne Welzel
7928f71f02 RecordType: Inline FieldDecl 2025-10-09 10:48:02 +02:00
Arne Welzel
b5f8256ee1 RecordType/RecordVal: Support ZValElement initialization
This will avoid IsManagedType() calls within the RecordVal constructor
and instead initialize slots based on the RecordType's types directly.

TypeDecl might not be the most appropriate place, but it does carry
enough information already and avoids adding a separate member
array-like member to RecordType mirroring the fields. Maybe TypeDecl could
be more thought of as FieldProperties ?
2025-10-09 10:48:02 +02:00
Arne Welzel
7fbeb56b15 logging/Manager: Adapt RawOptField() usage for ZValElement 2025-10-09 10:46:55 +02:00
Arne Welzel
35340f1033 RecordVal: Remove rt member
This doesn't seem to be really needed and costs 8 bytes per record value
2025-10-09 10:46:55 +02:00
Arne Welzel
a6b75bc380 RecordVal: Replace std::optional<ZVal> with ZValElement
Drop the is_managed reference and DeleteManagedType() helper that
is unused given all that information is stored in ZValElement
itself.
2025-10-09 10:46:55 +02:00
Arne Welzel
fc48e8c3ef Val: Introduce ZValElement
This introduces a new class for replacing the std::optional in
RecordVal's record_val vector. It may also be useful within
VectorVal in the future.
2025-10-09 10:46:28 +02:00
Arne Welzel
85ecec20eb Modifiable: No virtual destructor
There's only three classes that inherit from Modifiable today. The
virtual destructor adds an extra 8 byte vtable to every instance of
table, record or vector values.
Calling Unregister() explicitly from the destructors saves 8 bytes
of memory for each instance.
2025-10-09 10:45:26 +02:00
Arne Welzel
af9be9d7e5 RecordVal: Use const pointer in parse_time_records
It's just an index.
2025-10-09 10:45:26 +02:00
Arne Welzel
9345a8c84e Merge remote-tracking branch 'origin/topic/awelzel/4847-quic-discard-fixed-bit-is-zero'
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
* origin/topic/awelzel/4847-quic-discard-fixed-bit-is-zero:
  QUIC: Skip packets with fixed_bit 0
2025-10-09 09:16:53 +02:00
Arne Welzel
14429cf297 QUIC: Skip packets with fixed_bit 0
The RFC specifies that QUIC packets with unset fixed_bit need to be
discarded. Do so.

Fixes #4847
2025-10-09 09:14:56 +02:00
Arne Welzel
0ae4f4866a Update zeek-aux for zeek-archiver improvements
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
2025-10-08 19:31:30 +02:00
Arne Welzel
050035e33e Merge remote-tracking branch 'origin/topic/awelzel/writer-backend-no-heartbeat'
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
* origin/topic/awelzel/writer-backend-no-heartbeat:
  logging/writers: Disable heartbeats
  logging/WriterBackend: Support disabling heartbeats
2025-10-08 09:21:33 +02:00
Tim Wojtulewicz
f2eb709f07 Merge remote-tracking branch 'origin/topic/vern/standalone-global-inits'
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
* origin/topic/vern/standalone-global-inits:
  Reworked initialization of globals for -O gen-standalone-C++ code
2025-10-07 09:33:44 -07:00
Vern Paxson
3899e449a7 Reworked initialization of globals for -O gen-standalone-C++ code 2025-10-07 09:18:49 -07:00
Tim Wojtulewicz
cd4c3bce88 Merge remote-tracking branch 'origin/topic/timw/4545-smb-gmtime'
* origin/topic/timw/4545-smb-gmtime:
  Remove SMB_time and SMB_date record types
  SMB: Init lanman time and set TZ correctly before calling mktime
2025-10-07 09:16:26 -07:00
Tim Wojtulewicz
8a1937a0e0 Merge remote-tracking branch 'origin/topic/vern/standalone-enum-fix'
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
* origin/topic/vern/standalone-enum-fix:
  fix to enable -O gen-standalone-C++ code to extend enum types
2025-10-03 14:07:14 -07:00
Vern Paxson
0358ac3f48 fix to enable -O gen-standalone-C++ code to extend enum types 2025-10-03 14:06:53 -07:00
Tim Wojtulewicz
73746b694e Merge remote-tracking branch 'origin/topic/timw/coverity-fixes'
* origin/topic/timw/coverity-fixes:
  Fix some recent Coverity findings
2025-10-03 09:13:39 -07:00
zeek-bot
332f662d6f Update doc submodule [nomail] [skip ci] 2025-10-03 00:21:42 +00:00
Arne Welzel
4de7a2b947 Merge remote-tracking branch 'origin/topic/awelzel/4845-get-current-packet-header-fragmented-syn'
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
* origin/topic/awelzel/4845-get-current-packet-header-fragmented-syn:
  iosource/Packet: Allow ToRawPktHdrVal() for reassembled packets
2025-10-02 14:12:22 +02:00
Arne Welzel
ca58c5e6b4 iosource/Packet: Allow ToRawPktHdrVal() for reassembled packets
Closes #4845
2025-10-02 14:10:09 +02:00
Arne Welzel
d9af53bdd7 logging/writers: Disable heartbeats
None of the built-in log writers have a use for heartbeats, disable
sending them to the thread.
2025-10-02 09:59:43 +02:00
Arne Welzel
65e311b575 logging/WriterBackend: Support disabling heartbeats
The regular heartbeats to the WriterBackend threads can result in
significant processing overhead when analyzing long and sparse PCAPs
for which the number of heartbeat messages far exceeds the number of
log writes. This patch allows implementors to disable heartbeats.

Relates to discussion #4731
2025-10-02 09:50:04 +02:00
Arne Welzel
4e9b40f290 Merge remote-tracking branch 'origin/topic/awelzel/conn-class-layout-packing'
* origin/topic/awelzel/conn-class-layout-packing:
  Conn: Improve packing, drop bitfields and boolenize
  Conn: Lazily initialize weird_state when needed
2025-10-02 09:15:33 +02:00
Arne Welzel
d1051df887 Conn: Improve packing, drop bitfields and boolenize
There's a few holes in Conn, particularly now that TransportProto has
become a uint8_t. Pack things a bit more neatly.
2025-10-02 09:13:03 +02:00
Arne Welzel
d5045e08e3 Conn: Lazily initialize weird_state when needed
A std::unordered_map takes 56 bytes on my system. Switch to a unique_ptr
an initialize weird_state lazily. That saves ~48 bytes per connection.
Particularly for scan or non-weird traffic, this should allow some
memory savings.
2025-10-02 09:13:03 +02:00
Tim Wojtulewicz
66f9695927 Fix some recent Coverity findings 2025-09-30 15:57:17 -07:00
Tim Wojtulewicz
8b4707a284 Merge remote-tracking branch 'origin/topic/vern/id-redecl'
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
* origin/topic/vern/id-redecl:
  fixes for re-declaring type identifiers in inconsistent ways - addresses GH-2686
2025-09-30 20:46:38 +00:00
Tim Wojtulewicz
99fa163db2 Merge remote-tracking branch 'origin/topic/vern/standalone-BiF-access'
* origin/topic/vern/standalone-BiF-access:
  Fix for standalone initializations that require BiFs, and streamlining of standalone BiF-tracking
2025-09-30 20:45:28 +00:00
Tim Wojtulewicz
63291eca75 Merge remote-tracking branch 'origin/topic/vern/opt-skip-file-fix'
* origin/topic/vern/opt-skip-file-fix:
  fixed bug in logic for including/excluding files for script optimization
2025-09-30 20:12:24 +00:00
Tim Wojtulewicz
85b4cec76e Merge remote-tracking branch 'origin/topic/timw/remove-checks-for-very-old-openssl-versions'
* origin/topic/timw/remove-checks-for-very-old-openssl-versions:
  Remove checks for OpenSSL 1.x versions
  Remove some additional LibreSSL checks
2025-09-30 19:12:16 +00:00
Vern Paxson
6471a7bf7b Fix for standalone initializations that require BiFs, and streamlining of standalone BiF-tracking 2025-09-30 11:11:50 -07:00
Vern Paxson
fada719620 fixed bug in logic for including/excluding files for script optimization 2025-09-30 10:40:01 -07:00
Tim Wojtulewicz
a27cc89335 Remove checks for OpenSSL 1.x versions 2025-09-29 10:23:28 -07:00
Tim Wojtulewicz
686f100f0d Remove some additional LibreSSL checks 2025-09-29 10:23:28 -07:00
Arne Welzel
6af1459f5e Merge remote-tracking branch 'origin/topic/awelzel/4849-supervisor-signal-handle-tsan'
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
* origin/topic/awelzel/4849-supervisor-signal-handle-tsan:
  Supervisor: Make last_signal atomic to squelch data race
2025-09-29 18:04:49 +02:00
Tim Wojtulewicz
c1faef38f8 Remove SMB_time and SMB_date record types 2025-09-29 08:56:49 -07:00
Tim Wojtulewicz
8efddf87d9 SMB: Init lanman time and set TZ correctly before calling mktime
This makes a change to the record for smb1-negotiate-response as well.
Times and dates are two 2-byte sections, not three. Switch the parsing
to just use two uint16s, and pass those into the lanman time conversion
function.
2025-09-29 08:56:49 -07:00
Tim Wojtulewicz
3c16ee9667 Update docs submodule [nomail] 2025-09-29 08:21:10 -07:00
Arne Welzel
31d7df915e Supervisor: Make last_signal atomic to squelch data race
When the stem process terminates and SIGCHLD is sent to the supervisor,
the signal might be handled by the main thread or any other threads that
aren't blocking SIGCHLD explicitly. Convert last_signal to a std::atomic<int>
such that non-main threads can safely set last_signal without triggering
data race as reported by TSAN. This doesn't make it less racy to work
last_signal, but it appears we only use it for debug printing anyhow and
another option might have been to just remove last_signal altogether.

Follow-up for #4849
2025-09-29 14:50:20 +02:00
Arne Welzel
3abc1116a1 Merge remote-tracking branch 'origin/topic/awelzel/zeromq-fix-block-subscribe-before-init'
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
* origin/topic/awelzel/zeromq-fix-block-subscribe-before-init:
  cluster/zeromq: Fix Cluster::subscribe() block if not initialized
2025-09-29 13:08:32 +02:00
Vern Paxson
941ecee692 fixes for re-declaring type identifiers in inconsistent ways - addresses GH-2686 2025-09-27 22:23:57 -07:00
Tim Wojtulewicz
0700427bac Merge remote-tracking branch 'origin/topic/vern/standalone-fixes2'
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
* origin/topic/vern/standalone-fixes2:
  Fixes for -O gen-standalone-C++ for tracking BiFs, lambdas, attribute types, and independent globals
2025-09-26 14:19:49 -07:00
Tim Wojtulewicz
483d9a3a93 Merge remote-tracking branch 'klemensn/openbsd-libressl'
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
* klemensn/openbsd-libressl:
  OpaqueVal, OCSP, X509: drop outdated LibreSSL guards to fix OpenBSD build
2025-09-26 11:21:17 -07:00
Tim Wojtulewicz
83f05dde34 Merge remote-tracking branch 'origin/topic/timw/merge-3rdparty-repo-into-main'
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
* origin/topic/timw/merge-3rdparty-repo-into-main: (30 commits)
  Ignore src/3rdparty for pre-commit
  src/3rdparty: Port doctest fix for including <ciso646> from upstream
  src/3rdparty: Update doctest to v2.4.12
  src/3rdparty: Move jthread/stop_token out of std namespace to prevent collisions
  src/3rdparty: Fix clang-tidy bugprone-casting-through-void warning
  src/3rdparty: Add jthread and stop_token headers
  src/3rdparty: Update SQLite to 3.47.1
  src/3rdparty: Upgrade sqlite3 to 3.45.0
  src/3rdparty: modp: Disable deprecation warning for sprintf
  src/3rdparty: Update SQLite to 3.41.2
  src/3rdparty: Handle zeek-inet-ntop snprintf() return value correctly
  src/3rdparty: Rework inet-ntop change to build on Windows
  src/3rdparty: Use snprintf in zeek_inet_ntop.c to silence macOS compiler warnings
  src/3rdparty: Use snprintf in patricia.cc to silence macOS compiler warnings
  src/3rdparty: Update ConvertUTF Unicode license as per request from LLVM upstream
  src/3rdparty: Update doctest to 2.4.9 and sqlite to 3.39.4
  src/3rdparty: Fix rampant off-by-one error in last change
  src/3rdparty: numeric conversion functions now return the number of characters added
  src/3rdparty: Fix GCC 12.2 warning in access to patricia_t members
  src/3rdparty: Rebase patricia.{h,c} on upstream version
  ...
2025-09-26 02:57:42 +00:00
Tim Wojtulewicz
7627022f92 Ignore src/3rdparty for pre-commit 2025-09-25 18:39:07 -07:00
Tim Wojtulewicz
663fc2931c src/3rdparty: Port doctest fix for including <ciso646> from upstream
This has been failing on our weekly builds for a bit. It's fixed upstream
but there's no idea when they'll release a new version that includes it.

This cherry-picks 5eb20178ba
2025-09-25 18:39:07 -07:00
Tim Wojtulewicz
08b018cc61 src/3rdparty: Update doctest to v2.4.12 2025-09-25 18:39:07 -07:00