From nobody Thu Oct 09 12:36:28 2025 X-Original-To: dev-commits-src-branches@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 4cj8WK18yqz6BrtC; Thu, 09 Oct 2025 12:36:29 +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 4cj8WJ54fPz3Y6Q; Thu, 09 Oct 2025 12:36:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760013388; 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=rqv0V0CQonGitumOItn0A4F2KmwVn2w0LkCGCnUpMxQ=; b=metLLUqY8r85MPWzGi9NM2qNYiOELiiiBN9NtnomLxZPd9gN4MZJe9H+fi6ivcmuOoSr/y ecFus4jcHEHXwIUOYEE3T7pcG1QmHY7j5UjIwQZR5rZWJ+6qAQCj9d30Dv4XRi4dbAo35V N74IoTGIzkSv6Mivb1iIvE48Vn9mumvCKJY1XMujYrrnWjdpznocu70bEUze5hpqzw3QVX TEVOiMXvPzC8IoaP5BrHCaJMCHvJ3wx9XsO27n1q4WkLmEIUPtLajpspWFkGOJMywBZwwl 9A6klEbAYrH1C2xGSzJhBp/koB35dVOrscZo0GchfFjkeeZ20CdNw/Hru/M1SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760013388; 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=rqv0V0CQonGitumOItn0A4F2KmwVn2w0LkCGCnUpMxQ=; b=qqPZq3VztjXc4rNKHlryc6n11h3tXBBW7xuP/tXg9SZILglGfQ1xeQtFMAswMBNUQccrvM pZa4XyVxxrEfTMeg2Od++Izlz+CsJOcwFx4wjycnbUO7UYcj/Y3cZSIJ2/6GZwuOyZWvvP VQM8/l3vYIHyN8WvflOZTdb/u7Y2K5vpCdgajqTkecFHq0iwc5B/RDJlm1MwzoGQLL07PR 7R6RjZOaHiu1/ZuecZZ489SB2VoI/iBexiG2f2G/8LD6yhhL7VyM6qzBYOUnw22hAOWo0s LxhM2Wq89w3sW+MCgi1Hkn4ZuKXZYwpdrmKP2oMBZXYolnH5EYhcvk/KDKW/gg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1760013388; a=rsa-sha256; cv=none; b=K++n/fKdHWHQx6DT1Wm/K8+ndQ47M7mdXCjLOjMTNy16JBuN9wkwPo9ZWFxeqKaWghEU12 i8T5r8pIdPK/I1It2gchEUAB17+4h1KtVEvJRBhjG0JwtdeBslb1k2dyX0ICqnGKkMrlJw pZSuG5ruKB+X//v05ZUaQlr8LjGIucqNOsso8T80Y3lVv0CscGRPqr5KkJyiL9RIG2dfRF DcC3LVozEZZgf6KoHzXo5lnKTR7yyrKlLBSceN1xgzhStkUSmw5oimWrfF0ffgC0oEMeCO ZPvQ99t/uXTlS5emDQON1goLBQDjOPLLdj0lsDCtokmkyYoN50+ZfRYLAuSjKw== 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 4cj8WJ4X8tz2tp; Thu, 09 Oct 2025 12:36:28 +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 599CaSvY071928; Thu, 9 Oct 2025 12:36:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 599CaSE4071925; Thu, 9 Oct 2025 12:36:28 GMT (envelope-from git) Date: Thu, 9 Oct 2025 12:36:28 GMT Message-Id: <202510091236.599CaSE4071925@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: 26e0bf6015d3 - stable/15 - ipfilter/ippool: Dump a copy of ippool hash data in "new" format List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/15 X-Git-Reftype: branch X-Git-Commit: 26e0bf6015d3729e99aeca12418754e30e9395eb Auto-Submitted: auto-generated The branch stable/15 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=26e0bf6015d3729e99aeca12418754e30e9395eb commit 26e0bf6015d3729e99aeca12418754e30e9395eb Author: Cy Schubert AuthorDate: 2022-11-02 05:46:41 +0000 Commit: Cy Schubert CommitDate: 2025-10-09 12:36:20 +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",