From: Stephen Donnelly Date: Mon, 12 Oct 2009 20:49:57 +0000 (+1300) Subject: Improve dag_platform_finddevs range and efficiency. X-Git-Tag: libpcap-1.2.1~84^2~4 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/ad4052e8f4845eddebfd9be05f23e40bd2cbe924 Improve dag_platform_finddevs range and efficiency. Find dags 0-31 instead of 0-9. Find streams up to DAG_MAX_STREAMS (currently 64) not 16. Use rxstreams count to reduce number of test attaches required. --- diff --git a/pcap-dag.c b/pcap-dag.c index 938ec26d..b5de0691 100644 --- a/pcap-dag.c +++ b/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