From ca7473f5fc9fea027c39a6d337441c3dce04c984 Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Fri, 17 Nov 2023 12:10:24 +0000 Subject: 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@ --- sbin/pflogd/pflogd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sbin/pflogd/pflogd.c') 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); -- cgit v1.2.3