aboutsummaryrefslogtreecommitdiff
path: root/contrib/blocklist
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/blocklist')
-rw-r--r--contrib/blocklist/bin/blacklistd.c8
-rw-r--r--contrib/blocklist/bin/blocklistctl.82
-rw-r--r--contrib/blocklist/bin/blocklistd.c8
-rw-r--r--contrib/blocklist/bin/state.c6
-rwxr-xr-xcontrib/blocklist/libexec/blocklistd-helper4
5 files changed, 14 insertions, 14 deletions
diff --git a/contrib/blocklist/bin/blacklistd.c b/contrib/blocklist/bin/blacklistd.c
index b5f9358122ef..cb6ce6578d9c 100644
--- a/contrib/blocklist/bin/blacklistd.c
+++ b/contrib/blocklist/bin/blacklistd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: blocklistd.c,v 1.11 2025/10/25 16:55:23 christos Exp $ */
+/* $NetBSD: blocklistd.c,v 1.12 2025/10/25 18:43:51 christos Exp $ */
/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: blocklistd.c,v 1.11 2025/10/25 16:55:23 christos Exp $");
+__RCSID("$NetBSD: blocklistd.c,v 1.12 2025/10/25 18:43:51 christos Exp $");
#include <sys/types.h>
#include <sys/socket.h>
@@ -329,8 +329,8 @@ again:
(*lfun)(LOG_INFO, "released %s/%d:%d after %d seconds",
buf, c.c_lmask, c.c_port, c.c_duration);
}
- state_del(state, &c);
- goto again;
+ if (state_del(state, &c) == 0)
+ goto again;
}
}
diff --git a/contrib/blocklist/bin/blocklistctl.8 b/contrib/blocklist/bin/blocklistctl.8
index 75228599a9de..d241f2844471 100644
--- a/contrib/blocklist/bin/blocklistctl.8
+++ b/contrib/blocklist/bin/blocklistctl.8
@@ -1,4 +1,4 @@
-.\" $NetBSD: blocklistctl.8,v 1.5 2025/10/25 16:56:27 christos Exp $
+.\" $NetBSD: blocklistctl.8,v 1.6 2025/10/26 13:49:22 christos Exp $
.\"
.\" Copyright (c) 2015 The NetBSD Foundation, Inc.
.\" All rights reserved.
diff --git a/contrib/blocklist/bin/blocklistd.c b/contrib/blocklist/bin/blocklistd.c
index c78c560613fc..47c145c7aae1 100644
--- a/contrib/blocklist/bin/blocklistd.c
+++ b/contrib/blocklist/bin/blocklistd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: blocklistd.c,v 1.11 2025/10/25 16:55:23 christos Exp $ */
+/* $NetBSD: blocklistd.c,v 1.12 2025/10/25 18:43:51 christos Exp $ */
/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: blocklistd.c,v 1.11 2025/10/25 16:55:23 christos Exp $");
+__RCSID("$NetBSD: blocklistd.c,v 1.12 2025/10/25 18:43:51 christos Exp $");
#include <sys/types.h>
#include <sys/socket.h>
@@ -329,8 +329,8 @@ again:
(*lfun)(LOG_INFO, "released %s/%d:%d after %d seconds",
buf, c.c_lmask, c.c_port, c.c_duration);
}
- state_del(state, &c);
- goto again;
+ if (state_del(state, &c) == 0)
+ goto again;
}
}
diff --git a/contrib/blocklist/bin/state.c b/contrib/blocklist/bin/state.c
index 08e2622e223f..bb93904f3489 100644
--- a/contrib/blocklist/bin/state.c
+++ b/contrib/blocklist/bin/state.c
@@ -1,4 +1,4 @@
-/* $NetBSD: state.c,v 1.2 2025/02/11 17:48:30 christos Exp $ */
+/* $NetBSD: state.c,v 1.3 2025/10/25 18:43:51 christos Exp $ */
/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: state.c,v 1.2 2025/02/11 17:48:30 christos Exp $");
+__RCSID("$NetBSD: state.c,v 1.3 2025/10/25 18:43:51 christos Exp $");
#include <sys/types.h>
#include <sys/socket.h>
@@ -131,7 +131,7 @@ state_del(DB *db, const struct conf *c)
(*lfun)(LOG_DEBUG, "%s: returns %d", __func__, rv);
(*db->sync)(db, 0);
}
- return 0;
+ return rv;
default:
(*lfun)(LOG_ERR, "%s: failed (%m)", __func__);
return -1;
diff --git a/contrib/blocklist/libexec/blocklistd-helper b/contrib/blocklist/libexec/blocklistd-helper
index 1d4a38b1d831..f27cde4ed4ea 100755
--- a/contrib/blocklist/libexec/blocklistd-helper
+++ b/contrib/blocklist/libexec/blocklistd-helper
@@ -258,8 +258,8 @@ flush)
pf)
# dynamically determine which anchors exist
for anchor in $(/sbin/pfctl -a "$2" -s Anchors 2> /dev/null); do
- /sbin/pfctl -a "$anchor" -t "port${anchor##*/}" -T flush 2> /dev/null
- /sbin/pfctl -a "$anchor" -F rules 2> /dev/null
+ /sbin/pfctl -a "$anchor" -t "port${anchor##*/}" -T flush
+ /sbin/pfctl -a "$anchor" -F rules
done
echo OK
;;