From nobody Thu Oct 2 19:06:18 2025 X-Original-To: dev-commits-src-main@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 4cd1VM1x33z69pWd; Thu, 02 Oct 2025 19:06:19 +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 4cd1VM01ldz3D38; Thu, 02 Oct 2025 19:06:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759431979; 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=KX1xvs48D73mEcSBEQ930wyVPvtWaL9Huo1LAz2AOoU=; b=QEQ6WCZ8p2t03HwuSXTBpJZOEUvhP5U+iEWxgLRgV1W2e3Ih+heje8m+idxztkX6jT6DdG w+oHxfaCY0HfQ/95z8aY+5qJBmLKAX/ueeZHghroPX8OPH3jCbtR3ap1//w8FTZpHDCZst Fip/nvnZF9lPtnxUcGnzsc/DwGTIA93cDIy04hubTx4YQf1N0fKPaQnN4rl/Z7UR5nKCez W2ys6CTRrXTaOho4IVTZj55aXcJ2bjGN4npceqIQH1pkZEEb3FIrUIQm3ZSgKYa8tVGVvZ z5R1Vo4jWypvpNu9MpsHBZP0wJjgmb+Lwhf4UIF/rqr7nYdqCguWp6cokOW3Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759431979; 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=KX1xvs48D73mEcSBEQ930wyVPvtWaL9Huo1LAz2AOoU=; b=Jeej1ODP5OMeNR2YJJQgAn3qQHLn2ox7T3YGG7oD+2T8NM+EWuKtk0PYxO7FWTXkPKrgSX i1vKGYjtYzJ6fSTjiBHbT42fW1n0XmAp/9pTKAmlfx77jlpxtEqbj1eOCz5oY6OvfiecgW oP/3UdDd7NvSfhqyBpp6tsXtJpdOpCRulPAvtqJsBALWWMacknuZstT3vhEpz1zOzA5mOT cDzHAQ+i8wfx+JYNy+IFvLCxROuD/4KdYejr1AquBfqo0ddg9QuPdsdrcYrEfDe47BB4DH zrufv/Ktwsknwy6SFiMpKMbGVOn/comklLzSVf2sya59q2481i9rp+bA0L8QYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759431979; a=rsa-sha256; cv=none; b=YJ93aGN1lgiDvnHwLH2yLjnE7oSxtSZEp/vrZYbqcvUMQLRLPPF6nZUx4hX5LHlqDiug2Q BNg0yBS62eugJJE7mm7Yfg7Kp/MQypfZ4I285rCBVkBTuOLFVT+9o7pFwixOORzr6lDAeM pBPJdERdL82VhdgBTW8o/9RzFbN/BrYK8+gBYpWLuKbE7M9Z3w4PElUJLjBLIpAAe5cCju DNHv1ZGNi3B7jpUZi6Yfo/7j2aBS/571c94tcr6S0YfkcfWhyz3FCUEU6+Ffby9zyvnnDu y1OC2YGit8Q4A23vf42lBMGH+PXzSknooqX1fVHmqmiwRhmKd27bVgZCVtXj2g== 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 4cd1VL62Xcz5SV; Thu, 02 Oct 2025 19:06:18 +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 592J6IB0078756; Thu, 2 Oct 2025 19:06:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 592J6ITR078753; Thu, 2 Oct 2025 19:06:18 GMT (envelope-from git) Date: Thu, 2 Oct 2025 19:06:18 GMT Message-Id: <202510021906.592J6ITR078753@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 2f30b43fa269 - main - ipfilter/ippool: Dump a copy of ippool hash data in "new" format List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 2f30b43fa269bc63086b0428f45c79e982abb02f Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=2f30b43fa269bc63086b0428f45c79e982abb02f commit 2f30b43fa269bc63086b0428f45c79e982abb02f Author: Cy Schubert AuthorDate: 2022-11-02 05:46:41 +0000 Commit: Cy Schubert CommitDate: 2025-10-02 19:03:35 +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. MFC after: 1 week --- 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",