From: Christopher K Lee Date: Fri, 15 May 2015 15:20:48 +0000 (-0700) Subject: Allow pcap_set_buffer_size() value in bytes to set SNF_DATARING_SIZE X-Git-Tag: libpcap-1.9.0-rc1~41^2~4 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/52faf1ba5a31420859dd03b5fb80e4ceaaa6ce35?hp=-c Allow pcap_set_buffer_size() value in bytes to set SNF_DATARING_SIZE in pcap-snf.c. value is adjusted to the minimum of 1MB. --- 52faf1ba5a31420859dd03b5fb80e4ceaaa6ce35 diff --git a/pcap-snf.c b/pcap-snf.c index 0eefb5d4..442a6048 100644 --- a/pcap-snf.c +++ b/pcap-snf.c @@ -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) {