]> The Tcpdump Group git mirrors - libpcap/commitdiff
Allow pcap_set_buffer_size() value in bytes to set SNF_DATARING_SIZE
authorChristopher K Lee <[email protected]>
Fri, 15 May 2015 15:20:48 +0000 (08:20 -0700)
committerChristopher K Lee <[email protected]>
Fri, 15 May 2015 15:20:48 +0000 (08:20 -0700)
  in pcap-snf.c. value is adjusted to the minimum of 1MB.

pcap-snf.c

index 0eefb5d4fdb059836b4a888b0fe34c71845d7657..442a6048a79074c28ac7d1c72634e6cdc8c193f9 100644 (file)
@@ -268,7 +268,7 @@ snf_activate(pcap_t* p)
        err = snf_open(ps->snf_boardnum,
                        0, /* let SNF API parse SNF_NUM_RINGS, if set */
                        NULL, /* default RSS, or use SNF_RSS_FLAGS env */
-                       p->opt.buffer_size, /* default to SNF_DATARING_SIZE from env */
+                       p->opt.buffer_size < 1048576 ? 1048576 : p->opt.buffer_size, /* default to SNF_DATARING_SIZE from env */
                        flags, /* may want pshared */
                        &ps->snf_handle);
        if (err != 0) {