Module Name: src
Committed By: christos
Date: Thu Jan 5 16:23:31 UTC 2017
Modified Files:
src/usr.sbin/npf/npfd: npfd_log.c
Log Message:
set the timeout to 1 second so we can see packets flowing in real time.
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/npf/npfd/npfd_log.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/npf/npfd/npfd_log.c
diff -u src/usr.sbin/npf/npfd/npfd_log.c:1.4 src/usr.sbin/npf/npfd/npfd_log.c:1.5
--- src/usr.sbin/npf/npfd/npfd_log.c:1.4 Fri Dec 30 14:55:46 2016
+++ src/usr.sbin/npf/npfd/npfd_log.c Thu Jan 5 11:23:31 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: npfd_log.c,v 1.4 2016/12/30 19:55:46 christos Exp $ */
+/* $NetBSD: npfd_log.c,v 1.5 2017/01/05 16:23:31 christos Exp $ */
/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: npfd_log.c,v 1.4 2016/12/30 19:55:46 christos Exp $");
+__RCSID("$NetBSD: npfd_log.c,v 1.5 2017/01/05 16:23:31 christos Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -93,6 +93,10 @@ npfd_log_create(const char *ifname, cons
errx(EXIT_FAILURE, "pcap_set_snaplen failed: %s",
pcap_geterr(ctx->pcap));
+ if (pcap_set_timeout(ctx->pcap, 1000) == -1)
+ errx(EXIT_FAILURE, "pcap_set_timeout failed: %s",
+ pcap_geterr(ctx->pcap));
+
if (pcap_activate(ctx->pcap) == -1)
errx(EXIT_FAILURE, "pcap_activate failed: %s",
pcap_geterr(ctx->pcap));