Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Allow bigger D-Bus packets, but don't allocate big buffers initially.
D-Bus packets can be up to 128MB in size, but don't allocate 128MB for every pcap_t, or even every D-Bus pcap_t. Start out with enough to handle 2KB packets - that should be enough for most regular network packets - and grow the buffer as necessary to handle packets up to the snapshot length. Treat packets bigger than the maximum snapshot length for the link-layer type as errors; we continue to use MAXIMUM_SNAPLEN (256KB) for most link-layer header types, but use 128MB for DLT_DBUS, as per the above. If the snapshot length in the file header or IDB is 0, or is > 2^31-1, use the maximum snapshot length for the link-layer header type as the snapshot length. The check for 2^31-1 is there because the current API for snapshot lengths returns an int, and thus can't handle snapshot lengths > 2^31-1, even though the field is actually unsigned.
- Loading branch information
Showing
4 changed files
with
214 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters