From nobody Thu Oct 9 12:36:47 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cj8Wg6NMMz6Brw6; Thu, 09 Oct 2025 12:36:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cj8Wg3mr5z3ZCq; Thu, 09 Oct 2025 12:36:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760013407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qSG3HYkdmJOiECxLOfql8RbhZY3fwUEc9JGPkxXL1tU=; b=FVWhyH/wjp/nkh4gxsb7IjM14W+6XB1StiO5M/VYvwL8ITfDOBVgvSRH9k0Fr8C24ueNWS A7NhrrwFl73XAF+vgGTJgbG4UCImNICUmrkx7FDQDx9YqXBrf5l+JJcLqf/DwYmgtvo0e8 vwMtb6rBXfyhKn3tFdh3fu5Bw1Ij4d+dd57HFBCKkA9ADJkColF3sxeL8YRsg7dtQG5nKm xxJy+QIcjj7gG+GLOIlCtvKdxBauRxu7jqCStQFivlg7+RmxmvppQu1WY8B7wXB6iuLGJ+ swq4G3vRv9wh3DM7xKszWGdbMrKDSaxqGyLc5IKq6wsrPFuUizjTQ2oRPEgxEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760013407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qSG3HYkdmJOiECxLOfql8RbhZY3fwUEc9JGPkxXL1tU=; b=efLriGbA440JCI/By5YC+Yr2fj0F5KRcJwU6lTFpbO49YZpt94huzf2vU5r3ssQN6aIXBe 1aGChHkBKY74vHizKcGxKooM8TXejUdjAtIxunugKI0FosOa9OPvPgCsSwidrkJ2jKCU9i dm87msXJR7ahx3sE8GLytH8pR6btdfR2xZC15q5mbtA04xH7r3VPXvc7K8mOzI0x/EMj2M ZmAaqARMGzfafC0xkW3aAPP4NrMFQmImBXYd8ge4oREQCh+r92uPE60xQLRChel5ULBdMe pjc4J8msg37+V7x7NHDkYIXGeE3SI/g3vGi3DZyusWeaSM/qu4Kv24pX1J+sTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1760013407; a=rsa-sha256; cv=none; b=RCAxPjg04ZGyfYbQk90Eqsvclp0jv25ZS54K+OTuF8RCC/jfi5oBDOSTiW614CBAnwjQSO pLhbBuvSls0tYEf4vNPVN9hZhqRu75AAnepekvlnbugh1XC+sF5Cw2Kee1XqXFz3JX4j+B wTVCPNyOig1bv8FmCNJzg+/rK+bRrrA0nukzgYV+iJTIlycvKkMVofv+6TBZrSTDubFy5o /kr8QPysQPQMVfZrUaoNonAK4p71Os2qqwSbMYJrSqovsrj9YeJoRslEPP1ulpcTtrnzNS lyhuBKl/OFG4M1BaRsWHTpYfhWPp/DIylZBDb5aSClTI2N7QrBQhUvg0cOQfYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cj8Wg2vb8z2Z8; Thu, 09 Oct 2025 12:36:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 599CalsE072253; Thu, 9 Oct 2025 12:36:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 599Caln2072250; Thu, 9 Oct 2025 12:36:47 GMT (envelope-from git) Date: Thu, 9 Oct 2025 12:36:47 GMT Message-Id: <202510091236.599Caln2072250@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: ee01d543bf00 - stable/14 - ipfilter/ippool: Dump a copy of ippool hash data in "new" format List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ee01d543bf0068274b200b79187e9157ecced96a Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=ee01d543bf0068274b200b79187e9157ecced96a commit ee01d543bf0068274b200b79187e9157ecced96a Author: Cy Schubert AuthorDate: 2022-11-02 05:46:41 +0000 Commit: Cy Schubert CommitDate: 2025-10-09 12:36:40 +0000 ipfilter/ippool: Dump a copy of ippool hash data in "new" format As with 7531c434a593, which dumped ippool table data in the "new" format, print hash data in the "new" format. (cherry picked from commit 2f30b43fa269bc63086b0428f45c79e982abb02f) --- sbin/ipf/libipf/printhash_live.c | 8 ++++++-- sbin/ipf/libipf/printhashdata.c | 17 +++++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/sbin/ipf/libipf/printhash_live.c b/sbin/ipf/libipf/printhash_live.c index b8ee31b27597..427daa18316b 100644 --- a/sbin/ipf/libipf/printhash_live.c +++ b/sbin/ipf/libipf/printhash_live.c @@ -26,7 +26,9 @@ printhash_live(iphtable_t *hp, int fd, char *name, int opts, wordtab_t *fields) if ((hp->iph_flags & IPHASH_DELETE) != 0) PRINTF("# "); - if ((opts & OPT_DEBUG) == 0) + if (opts & OPT_SAVEOUT) + PRINTF("{\n"); + else if ((opts & OPT_DEBUG) == 0) PRINTF("\t{"); obj.ipfo_rev = IPFILTER_VERSION; @@ -50,6 +52,8 @@ printhash_live(iphtable_t *hp, int fd, char *name, int opts, wordtab_t *fields) last = 1; if (bcmp(&zero, &entry, sizeof(zero)) == 0) break; + if (opts & OPT_SAVEOUT) + PRINTF("\t"); (void) printhashnode(hp, &entry, bcopywrap, opts, fields); printed++; } @@ -59,7 +63,7 @@ printhash_live(iphtable_t *hp, int fd, char *name, int opts, wordtab_t *fields) if (printed == 0) putchar(';'); - if ((opts & OPT_DEBUG) == 0) + if ((opts & OPT_DEBUG) == 0 || (opts & OPT_SAVEOUT)) PRINTF(" };\n"); (void) ioctl(fd,SIOCIPFDELTOK, &iter.ili_key); diff --git a/sbin/ipf/libipf/printhashdata.c b/sbin/ipf/libipf/printhashdata.c index ba96a75a94d7..6fa62e67556d 100644 --- a/sbin/ipf/libipf/printhashdata.c +++ b/sbin/ipf/libipf/printhashdata.c @@ -12,7 +12,11 @@ void printhashdata(iphtable_t *hp, int opts) { - if ((opts & OPT_DEBUG) == 0) { + if (opts & OPT_SAVEOUT) { + if ((hp->iph_flags & IPHASH_DELETE) == IPHASH_DELETE) + PRINTF("# "); + PRINTF("pool "); + } else if ((opts & OPT_DEBUG) == 0) { if ((hp->iph_type & IPHASH_ANON) == IPHASH_ANON) PRINTF("# 'anonymous' table refs %d\n", hp->iph_ref); if ((hp->iph_flags & IPHASH_DELETE) == IPHASH_DELETE) @@ -50,7 +54,16 @@ printhashdata(iphtable_t *hp, int opts) printunit(hp->iph_unit); - if ((opts & OPT_DEBUG) == 0) { + if ((opts & OPT_SAVEOUT)) { + if ((hp->iph_type & ~IPHASH_ANON) == IPHASH_LOOKUP) + PRINTF("/hash"); + PRINTF("(%s \"%s\"; size %lu;", + ISDIGIT(*hp->iph_name) ? "number" : "name", + hp->iph_name, (u_long)hp->iph_size); + if (hp->iph_seed != 0) + PRINTF(" seed %lu;", hp->iph_seed); + PRINTF(")\n", hp->iph_seed); + } else if ((opts & OPT_DEBUG) == 0) { if ((hp->iph_type & ~IPHASH_ANON) == IPHASH_LOOKUP) PRINTF(" type=hash"); PRINTF(" %s=%s size=%lu",