Skip to content

Commit

Permalink
Expand a comment to explain why we clamp the snaphot length.
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
guyharris committed Aug 20, 2019
1 parent 2299015 commit 80a3a7e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pcap-int.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ extern "C" {
* 2) small enough not to cause attempts to allocate huge amounts of
* memory; some applications might use the snapshot length in a
* savefile header to control the size of the buffer they allocate,
* so a size of, say, 2^31-1 might not work well.
* so a size of, say, 2^31-1 might not work well. (libpcap uses it
* as a hint, but doesn't start out allocating a buffer bigger than
* 2 KiB, and grows the buffer as necessary, but not beyond the
* per-linktype maximum snapshot length. Other code might naively
* use it; we want to avoid writing a too-large snapshot length,
* in order not to cause that code problems.)
*
* We don't enforce this in pcap_set_snaplen(), but we use it internally.
*/
Expand Down

0 comments on commit 80a3a7e

Please sign in to comment.