Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Oct 2025 19:06:19 GMT
From:      Cy Schubert <cy@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: eee36ffa0d87 - main - ipfilter/ippool: Dump a copy of ippool dstlist data in "new" format
Message-ID:  <202510021906.592J6JXp078786@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by cy:

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

commit eee36ffa0d874f1c8aca912f7c2a8eba34509927
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2023-03-01 03:18:07 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2025-10-02 19:03:35 +0000

    ipfilter/ippool: Dump a copy of ippool dstlist data in "new" format
    
    As with 7531c434a593, which dumped ippool table data in the "new"
    format, print dstlist data in the "new" format.
    
    MFC after:      1 week
---
 sbin/ipf/libipf/printdstl_live.c   | 3 +++
 sbin/ipf/libipf/printdstlist.c     | 2 ++
 sbin/ipf/libipf/printdstlistdata.c | 5 ++---
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/sbin/ipf/libipf/printdstl_live.c b/sbin/ipf/libipf/printdstl_live.c
index 088448e6656d..72cb75a832c9 100644
--- a/sbin/ipf/libipf/printdstl_live.c
+++ b/sbin/ipf/libipf/printdstl_live.c
@@ -40,6 +40,9 @@ printdstl_live( ippool_dst_t *d, int fd, char *name, int opts,
 	if ((d->ipld_flags & IPHASH_DELETE) != 0)
 		PRINTF("# ");
 
+	if (opts & OPT_SAVEOUT)
+		PRINTF("{\n");
+
 	if ((opts & OPT_DEBUG) == 0)
 		PRINTF("\t{");
 
diff --git a/sbin/ipf/libipf/printdstlist.c b/sbin/ipf/libipf/printdstlist.c
index 2cf41ffe414c..497d7004c94c 100644
--- a/sbin/ipf/libipf/printdstlist.c
+++ b/sbin/ipf/libipf/printdstlist.c
@@ -42,6 +42,8 @@ printdstlist( ippool_dst_t *pp, copyfunc_t copyfunc, char *name, int opts,
 				return (NULL);
 			}
 
+			if (opts & OPT_SAVEOUT)
+				PRINTF("\t");
 			node = printdstlistnode(n, bcopywrap, opts, fields);
 
 			free(n);
diff --git a/sbin/ipf/libipf/printdstlistdata.c b/sbin/ipf/libipf/printdstlistdata.c
index 7940d2ae021b..546bf35cabf6 100644
--- a/sbin/ipf/libipf/printdstlistdata.c
+++ b/sbin/ipf/libipf/printdstlistdata.c
@@ -11,8 +11,7 @@
 void
 printdstlistdata( ippool_dst_t *pool, int opts)
 {
-
-	if ((opts & OPT_DEBUG) == 0) {
+	if ((opts & OPT_DEBUG) == 0 || opts & OPT_SAVEOUT) {
 		if ((pool->ipld_flags & IPDST_DELETE) != 0)
 			PRINTF("# ");
 		PRINTF("pool ");
@@ -24,7 +23,7 @@ printdstlistdata( ippool_dst_t *pool, int opts)
 
 	printunit(pool->ipld_unit);
 
-	if ((opts & OPT_DEBUG) == 0) {
+	if ((opts & OPT_DEBUG) == 0 || opts & OPT_SAVEOUT) {
 		PRINTF("/dstlist (name %s;", pool->ipld_name);
 		if (pool->ipld_policy != IPLDP_NONE) {
 			PRINTF(" policy ");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202510021906.592J6JXp078786>