git: 528e1d14037a - stable/15 - blocklist: blacklist: Chase recent upstream changes

From: Jose Luis Duran <jlduran_at_FreeBSD.org>
Date: Thu, 30 Oct 2025 01:52:18 UTC
The branch stable/15 has been updated by jlduran:

URL: https://cgit.FreeBSD.org/src/commit/?id=528e1d14037af30003b4451ec6f1686ea674621f

commit 528e1d14037af30003b4451ec6f1686ea674621f
Author:     Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2025-10-27 15:01:22 +0000
Commit:     Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2025-10-30 01:46:42 +0000

    blocklist: blacklist: Chase recent upstream changes
    
    Upstream introduced a fix that avoids blocklistd(8) from running into an
    endless loop when it tries to delete an address from the database which
    has been added multiple times.
    
    Apply the same fix to blacklistd(8).
    
    Upstream PR:    https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=57193
    MFC after:      2 days
    
    (cherry picked from commit b502a451cbae6a85636c7b8375f5ee53caca4388)
---
 contrib/blocklist/bin/blacklistd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 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;
 	}
 }