From nobody Mon Jan 22 18:20:05 2024 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 4TJdmk1PgRz57wll; Mon, 22 Jan 2024 18:20:06 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TJdmk0wLHz4r58; Mon, 22 Jan 2024 18:20:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705947606; 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=IE+ehwLtOheG8bKkZzRtFvcvDqyQWaHwrLqKcnMwcFY=; b=teaKNdNziQ1lPDoKU8gAWUfJwugPA88pn8A4oXFNFooodsu4uESykpanqaZgUVJVwgHeL9 gO8nqh8X8fM9nALjL1o4XW4wUcJfeQS6aCyDxamASA4ZuMK13E85p5ilfCmAhGiWXk7DId meq8+1zCZ/KA3IZJKqwH2AcNJdYGPBO+doAWiC0t9Jw9UPj23FtcLai5fNRfJPX+W9u8my z/dHiY2cdwyn9jZncXOAxJ0+JNE+X8sSELL3ICzTu9/Wv4RSx2LeM7O4RGgdl6k1jRg0fq XJrUw8O5+t3F5Ta+FGJMJ7YPRTysMej0KfvTte6Pu9whJLWnGxZxdajHRFj6oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705947606; 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=IE+ehwLtOheG8bKkZzRtFvcvDqyQWaHwrLqKcnMwcFY=; b=J8G7bESHYVOhOuS78K0N9CNsN/f1jFUIen/PtVEJy0D9GUZuC8b9F6EENk4LI2IWxqCvPe kCdK9qs3kdk0D2Om1VVkNj2hxiCZBOb7LeWeJy1e7CNzfQB3XNSehdmTK+DTetr/XpgWLL AGiaek7OU1oQ0hK+XvM5TdmYAqKbyPpD3EPVLRy3j7QQYg7lgIZ1zuRk162EIWzW10085W S8yTpXMYvbI4LxlD/Bn67SxtDegl7xgBFTqgS4S+gb/RZcl/oduvMmH/nA0JbsR4hiv5wJ xRIe3VwvTAxhc5aeGq/mlYRuonfYmu7yoMvy8ORjfzrgWLXcnNbvaipGOmbC2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705947606; a=rsa-sha256; cv=none; b=UdQO0tti7FRPdTq/JLZm3FBtOARQ4DKNVR0bvtEfD+jU1TG+GUB18ylGkZSiRnFaKdjsps dH60zJ1CSQ9g92e9IwLbRjnWlyaPqrxSVck2ByAkuu8Gkgkl72SrCpIoPLwoX06Dxup4/5 vFd0lHdo06sEfjwe+X1l4WJ1opik5D9drrT+oOwU3KKfCq1ze7GejSD0UlaHKSEj7n2WFJ s4zsVpu3oIM2mw6Z4kSd2ZP1Qu3J5Y9t1LnxkMtbM5eKcaXHrFnctmDR1z2l46bhjVKRK7 l1Pen+ziFDqEa4336U1gtZFJwspojVO0SgLeZmVRHU38cg7hSAFzMkN5b6UfHA== 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 4TJdmj6zphz1C3Y; Mon, 22 Jan 2024 18:20:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40MIK55l096575; Mon, 22 Jan 2024 18:20:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40MIK5r5096570; Mon, 22 Jan 2024 18:20:05 GMT (envelope-from git) Date: Mon, 22 Jan 2024 18:20:05 GMT Message-Id: <202401221820.40MIK5r5096570@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 484e977f2441 - main - pflow: observation domain is an unsigned integer 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 484e977f24418afa848d7ea1531b4379446d6065 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=484e977f24418afa848d7ea1531b4379446d6065 commit 484e977f24418afa848d7ea1531b4379446d6065 Author: Kristof Provost AuthorDate: 2024-01-22 16:34:44 +0000 Commit: Kristof Provost CommitDate: 2024-01-22 17:02:10 +0000 pflow: observation domain is an unsigned integer Ensure we print it as such, rather than as a signed integer, as that would lead to confusion. Reported by: Jim Pingle Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pflowctl/pflowctl.c | 2 +- tests/sys/netpfil/pf/pflow.sh | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/sbin/pflowctl/pflowctl.c b/sbin/pflowctl/pflowctl.c index 35daedfdf478..4186598dd9bc 100644 --- a/sbin/pflowctl/pflowctl.c +++ b/sbin/pflowctl/pflowctl.c @@ -340,7 +340,7 @@ get(int id) if (! snl_parse_nlmsg(&ss, hdr, &get_parser, &g)) continue; - printf("pflow%d: version %d domain %d", g.id, g.version, g.obs_dom); + printf("pflow%d: version %d domain %u", g.id, g.version, g.obs_dom); print_sockaddr(" src ", &g.src.storage); print_sockaddr(" dst ", &g.dst.storage); printf("\n"); diff --git a/tests/sys/netpfil/pf/pflow.sh b/tests/sys/netpfil/pf/pflow.sh index 3cef5f5a2d98..10efcbb93ac4 100644 --- a/tests/sys/netpfil/pf/pflow.sh +++ b/tests/sys/netpfil/pf/pflow.sh @@ -282,6 +282,30 @@ rule_cleanup() pft_cleanup } +atf_test_case "obs_dom" "cleanup" +obs_dom_head() +{ + atf_set descr 'Test configuring observation domain values' + atf_set require.user root +} + +obs_dom_body() +{ + pflow_init + + vnet_mkjail alcatraz + + pflow=$(jexec alcatraz pflowctl -c) + jexec alcatraz pflowctl -s ${pflow} domain 2300000000 + atf_check -o match:".*domain 2300000000.*" -s exit:0 \ + jexec alcatraz pflowctl -l +} + +obs_dom_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic" @@ -289,4 +313,5 @@ atf_init_test_cases() atf_add_test_case "v6" atf_add_test_case "nat" atf_add_test_case "rule" + atf_add_test_case "obs_dom" }