aboutsummaryrefslogtreecommitdiff
path: root/pcap-bt-linux.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-06-01 13:44:32 -0700
committerGuy Harris <guy@alum.mit.edu>2017-06-01 13:44:32 -0700
commit1a6b088a88886eac782008f37a7219a32b86da45 (patch)
tree12de58432416eb4aa4761ca65272e36ced564db1 /pcap-bt-linux.c
parent28f1b2074cba0c89c3ccbcf0d359f86d6519a73e (diff)
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.
Diffstat (limited to 'pcap-bt-linux.c')
0 files changed, 0 insertions, 0 deletions