aboutsummaryrefslogtreecommitdiff
path: root/contrib/libpcap/pcap-dag.c
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2012-05-14 05:12:56 +0000
committerXin LI <delphij@FreeBSD.org>2012-05-14 05:12:56 +0000
commitd1e8733132ce92d068898e4b3fe25ce17d634590 (patch)
tree158e6045ed438c41ac8de6cb27ac3c73cdc6643a /contrib/libpcap/pcap-dag.c
parent47db53c31a5ec643382c4b08c3f68dd4ccdf79d9 (diff)
parent5a0615f5c40ce036a7e13cfffe00927f845ad563 (diff)
downloadsrc-d1e8733132ce92d068898e4b3fe25ce17d634590.tar.gz
src-d1e8733132ce92d068898e4b3fe25ce17d634590.zip
Merge from vendor branch: update libpcap to 1.2.1.
MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=235426
Diffstat (limited to 'contrib/libpcap/pcap-dag.c')
-rw-r--r--contrib/libpcap/pcap-dag.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/contrib/libpcap/pcap-dag.c b/contrib/libpcap/pcap-dag.c
index 938ec26dce45..b5de0691b95a 100644
--- a/contrib/libpcap/pcap-dag.c
+++ b/contrib/libpcap/pcap-dag.c
@@ -879,8 +879,8 @@ dag_platform_finddevs(pcap_if_t **devlistp, char *errbuf)
int dagstream;
int dagfd;
- /* Try all the DAGs 0-9 */
- for (c = 0; c < 9; c++) {
+ /* Try all the DAGs 0-31 */
+ for (c = 0; c < 32; c++) {
snprintf(name, 12, "dag%d", c);
if (-1 == dag_parse_name(name, dagname, DAGNAME_BUFSIZE, &dagstream))
{
@@ -897,7 +897,7 @@ dag_platform_finddevs(pcap_if_t **devlistp, char *errbuf)
{
int stream, rxstreams;
rxstreams = dag_rx_get_stream_count(dagfd);
- for(stream=0;stream<16;stream+=2) {
+ for(stream=0;stream<DAG_STREAM_MAX;stream+=2) {
if (0 == dag_attach_stream(dagfd, stream, 0, 0)) {
dag_detach_stream(dagfd, stream);
@@ -908,6 +908,11 @@ dag_platform_finddevs(pcap_if_t **devlistp, char *errbuf)
*/
ret = -1;
}
+
+ rxstreams--;
+ if(rxstreams <= 0) {
+ break;
+ }
}
}
}