From nobody Thu Oct 9 12:37:05 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 4cj8X170zzz6BrPk; Thu, 09 Oct 2025 12:37:05 +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 4cj8X12YFhz3b1t; Thu, 09 Oct 2025 12:37:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760013425; 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=0/wMuxpbvUD8LxH9O5SVfFBk+dBCJ+xrmiaRb+AVRHs=; b=BM9UZmZATJfhbXFx6UPsd7fmL/Xa9dmDkOrat1uraqajpMt41U87PHellHH7mznchivkPf vnV68zuVifT85LKCEAMG0fAfPUxXyj/VlI5Cqu7xZNTbT+z5Lne6fQt2dWI6Kq2bTzbMqC tl947ePA6VrFmZNdhnUi4EPBtoH455fv+ZkqEfAfd/Qc2mEfByUJM3g4nWOxijuwoZGt2v Awqd/4iyGxCXUCgp3DjKW5zuWcWKsQeAz+WGxps/M3F+kEwMwf9NuKDyB0QYB4D2fCN406 YSLet0OYUO00O7XMUsFYfE6SFKNqdUfclJKk8cRrdpf4p2Zoijwf+/P3BEXSUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760013425; 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=0/wMuxpbvUD8LxH9O5SVfFBk+dBCJ+xrmiaRb+AVRHs=; b=a5Qqj27vVCTVgl7JNtg43OICiljSnQkTWg47xGf1zSMqiv6t19AhJ6D2ySFjxk1Y90osj+ dJuLxg6WeGyRUvEW5gdsaEnJdfGBsRLy0BRwT95GEwzP72WmuVaOx4IpaAQ5ddB5KHnOUc 3gmjNNBDQ6PuuqFeS5P47serqjD/68onFw4u2u9e7wDtNWzL0oAUgQDPbjW1dxu7hHXzos t9YNfe1WPc1JqdvekOOwZEaC8aXeHgfP+gNw1FUcl6M8RSswDZ3ES/EYKrpazKy/1lT7nL zT2CvmdvYfvN3vCFgY/SnQKbU9gZf51wNSZ3JoyGjlDs2pUqm6fHEQIrI/aH0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1760013425; a=rsa-sha256; cv=none; b=uP7+jT3dEEz2P9qh7RTMpLBLGwgPkHnzSOH6pHAeIbukxBBNPHOT/5r5y6/yk6efSwlCgA N4OZnaVlwI3zdfISaBkCg6uRSqexGJQws8Djgd9b25TR7N/FmbHcR+fMbBZkXZaSXVn0Pb mvwo+vzOZhwqkagrjfwHJJInX4w3cAy35jRBYkp4OCA1ki5rzEQzJHlNo9o/OfXtwAd0XP ibA+kE49GJ1eQfMPL/Bh/8WJx8RSduPcLexz6f/qFlhclWNUXtO0mogIez30szvLtwb0rc IEsm9kRiAHcc5Vd2i342HBgspJVXWLCUTHiAUYtgdTNVN/MxZX4hFVWMvXkWEA== 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 4cj8X11nP5z2B6; Thu, 09 Oct 2025 12:37:05 +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 599Cb5VK072596; Thu, 9 Oct 2025 12:37:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 599Cb5Sf072593; Thu, 9 Oct 2025 12:37:05 GMT (envelope-from git) Date: Thu, 9 Oct 2025 12:37:05 GMT Message-Id: <202510091237.599Cb5Sf072593@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: 96870b5accc9 - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 96870b5accc9260c0f0098d88ea3f56573b1e417 Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=96870b5accc9260c0f0098d88ea3f56573b1e417 commit 96870b5accc9260c0f0098d88ea3f56573b1e417 Author: Cy Schubert AuthorDate: 2022-11-02 05:46:41 +0000 Commit: Cy Schubert CommitDate: 2025-10-09 12:36:57 +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",