aboutsummaryrefslogtreecommitdiff
path: root/dlpisubs.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-05-08 13:06:27 -0700
committerGuy Harris <guy@alum.mit.edu>2013-05-08 13:06:27 -0700
commit48bc6c35b191857f39b628bd586bd94a03fd13d7 (patch)
treeb44a5a8e6e645194d16d4ddef0a03f0e61509a2d /dlpisubs.c
parent98b7898b2a9906714cc91c818a820f7e47da41b2 (diff)
Add an API to set "immediate mode".
In "immediate mode", packets are delivered as soon as they arrive.
Diffstat (limited to 'dlpisubs.c')
-rw-r--r--dlpisubs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/dlpisubs.c b/dlpisubs.c
index 738f4b93..efeabdf7 100644
--- a/dlpisubs.c
+++ b/dlpisubs.c
@@ -273,7 +273,7 @@ pcap_process_mactype(pcap_t *p, u_int mactype)
* Push and configure the buffer module. Returns -1 for error, otherwise 0.
*/
int
-pcap_conf_bufmod(pcap_t *p, int snaplen, int timeout)
+pcap_conf_bufmod(pcap_t *p, int snaplen)
{
int retv = 0;
@@ -293,11 +293,11 @@ pcap_conf_bufmod(pcap_t *p, int snaplen, int timeout)
}
/* Set up the bufmod timeout. */
- if (timeout != 0) {
+ if (!p->opt.immediate && p->opt.timeout != 0) {
struct timeval to;
- to.tv_sec = timeout / 1000;
- to.tv_usec = (timeout * 1000) % 1000000;
+ to.tv_sec = p->opt.timeout / 1000;
+ to.tv_usec = (p->opt.timeout * 1000) % 1000000;
if (strioctl(p->fd, SBIOCSTIME, sizeof(to), (char *)&to) != 0) {
pcap_stream_err("SBIOCSTIME", errno, p->errbuf);
retv = -1;