git: 470c680cfbf5 - main - ipfilter: Print the pool name when adding a poolnode fails

From: Cy Schubert <cy_at_FreeBSD.org>
Date: Tue, 12 Nov 2024 03:28:15 UTC
The branch main has been updated by cy:

URL: https://cgit.FreeBSD.org/src/commit/?id=470c680cfbf5f6cd9ac392b210b97b41d02cd969

commit 470c680cfbf5f6cd9ac392b210b97b41d02cd969
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2024-11-07 01:26:37 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2024-11-12 03:15:45 +0000

    ipfilter: Print the pool name when adding a poolnode fails
    
    Printing the pool node (IP address) only leads to speculation which
    pool the failed add occurred. This is especially useful when the same
    IP address is listed in multiple pools.
    
    MFC after:      1 week
---
 sbin/ipf/libipf/load_poolnode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sbin/ipf/libipf/load_poolnode.c b/sbin/ipf/libipf/load_poolnode.c
index 8d65f019da43..7a01da9df94b 100644
--- a/sbin/ipf/libipf/load_poolnode.c
+++ b/sbin/ipf/libipf/load_poolnode.c
@@ -54,8 +54,8 @@ load_poolnode(int role, char *name, ip_pool_node_t *node, int ttl,
 		if ((opts & OPT_DONOTHING) == 0) {
 			char msg[255];
 
-			snprintf(msg, sizeof(msg), "%s pool node(%s/", what,
-				inet_ntoa(pn.ipn_addr.adf_addr.in4));
+			snprintf(msg, sizeof(msg), "%s pool(%s) node(%s/", what,
+				name, inet_ntoa(pn.ipn_addr.adf_addr.in4));
 			strlcat(msg, inet_ntoa(pn.ipn_mask.adf_addr.in4), sizeof(msg));
 			return (ipf_perror_fd(pool_fd(), iocfunc, msg));
 		}