summaryrefslogtreecommitdiff
path: root/sbin/pflogd
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2023-11-17 12:10:24 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2023-11-17 12:10:24 +0000
commitca7473f5fc9fea027c39a6d337441c3dce04c984 (patch)
treea2f4f50165f781f4f5d9f637886348c29d1c295c /sbin/pflogd
parent0ebf6c3cd7115bd046740942061f3a43e534e272 (diff)
Do not log errors form pcap_dispatch() caused by signals.
pcap_dispatch() returns -1 (PCAP_ERROR) or -2 (PCAP_ERROR_BREAK) the latter is used when a signal is received and is not an error. So limit the code to log errors to np == -1. OK semarie@ sashan@
Diffstat (limited to 'sbin/pflogd')
-rw-r--r--sbin/pflogd/pflogd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/pflogd/pflogd.c b/sbin/pflogd/pflogd.c
index 271e46326ee..ad4230c72ea 100644
--- a/sbin/pflogd/pflogd.c
+++ b/sbin/pflogd/pflogd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pflogd.c,v 1.65 2023/11/12 15:18:04 dlg Exp $ */
+/* $OpenBSD: pflogd.c,v 1.66 2023/11/17 12:10:23 claudio Exp $ */
/*
* Copyright (c) 2001 Theo de Raadt
@@ -725,7 +725,7 @@ main(int argc, char **argv)
while (1) {
np = pcap_dispatch(hpcap, PCAP_NUM_PKTS,
phandler, (u_char *)dpcap);
- if (np < 0) {
+ if (np == -1) {
if (!if_exists(interface)) {
logmsg(LOG_NOTICE, "interface %s went away",
interface);