git: a993eeb44de0 - stable/13 - ipfilter/libipf: printpool_live() consumer ignores return code

From: Cy Schubert <cy_at_FreeBSD.org>
Date: Thu, 06 Oct 2022 13:57:07 UTC
The branch stable/13 has been updated by cy:

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

commit a993eeb44de051b5be8d08cab8d122a889cb7b8e
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2022-09-22 18:26:23 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2022-10-06 13:56:27 +0000

    ipfilter/libipf: printpool_live() consumer ignores return code
    
    The single consumer of printpool_live() ignores the return code.
    Avoid wasting resources on this.
    
    (cherry picked from commit 00d8a28f19b21ce2955c0cf24a040824ec506da5)
---
 sbin/ipf/common/ipf.h            | 2 +-
 sbin/ipf/libipf/printpool_live.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sbin/ipf/common/ipf.h b/sbin/ipf/common/ipf.h
index b278d8ec5d6c..977b3f0fd105 100644
--- a/sbin/ipf/common/ipf.h
+++ b/sbin/ipf/common/ipf.h
@@ -318,7 +318,7 @@ extern ipf_dstnode_t *printdstlistnode(ipf_dstnode_t *, copyfunc_t,
 extern void printdstlistpolicy(ippool_policy_t);
 extern struct ip_pool_s *printpool(struct ip_pool_s *, copyfunc_t,
 					char *, int, wordtab_t *);
-extern struct ip_pool_s *printpool_live(struct ip_pool_s *, int,
+extern void printpool_live(struct ip_pool_s *, int,
 					     char *, int, wordtab_t *);
 extern void printpooldata(ip_pool_t *, int);
 extern void printpoolfield(void *, int, int);
diff --git a/sbin/ipf/libipf/printpool_live.c b/sbin/ipf/libipf/printpool_live.c
index c1d770b4ef77..9bb19f2888b4 100644
--- a/sbin/ipf/libipf/printpool_live.c
+++ b/sbin/ipf/libipf/printpool_live.c
@@ -9,7 +9,7 @@
 #include "netinet/ipl.h"
 
 
-ip_pool_t *
+void
 printpool_live(ip_pool_t *pool, int fd, char *name, int opts,
 	wordtab_t *fields)
 {
@@ -19,7 +19,7 @@ printpool_live(ip_pool_t *pool, int fd, char *name, int opts,
 	ipfobj_t obj;
 
 	if ((name != NULL) && strncmp(name, pool->ipo_name, FR_GROUPLEN))
-		return (pool->ipo_next);
+		return;
 
 	if (fields == NULL)
 		printpooldata(pool, opts);
@@ -71,5 +71,5 @@ printpool_live(ip_pool_t *pool, int fd, char *name, int opts,
 
 	(void) ioctl(fd,SIOCIPFDELTOK, &iter.ili_key);
 
-	return (pool->ipo_next);
+	return;
 }