From nobody Wed Sep 25 12:34:31 2024 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 4XDGPz45nVz5XQgB; Wed, 25 Sep 2024 12:34:31 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDGPz2PMgz3wbf; Wed, 25 Sep 2024 12:34:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727267671; 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=LgQO8dEUh+95YJVozSQV9eb+mZOIkEE2uE9h9Fh7PAc=; b=L0rtwEUsmDwWtdFiflKKHgBbYITf2hOYdoZHp0hPjwa9LV00+bTaUxQP3OZ8Z24+cufpKL 22T3hAvllIaUm0KiXka+IIC4iEbdMXI2UIDQlvSuDTKqu//e/P8splpc5pTmLptHcdISs4 ddw/fdpQ6WVUlqWWWYmmBGy8NSnjh+vaHre7mrW1vib9iFBWcm/mVC6ifXtdM02ABobvl1 io3wqNdLsyKuoPTmFlih9eDGoO5NVTEaarFzo/hzdrxyvRhG4O+700YbjiEoXgy7nXkUy8 Na4Ps8LywNFbhg3x3swxLdNybg3tV/JQTNDbEP7lRLgRCmgTlRMALoniQjeHrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727267671; 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=LgQO8dEUh+95YJVozSQV9eb+mZOIkEE2uE9h9Fh7PAc=; b=xLxhAqyy6nobKlEzw9cNNnGmGo2s2xhf3CwQXD0d9VX92AUGTKgP5EyLbnvuWlJD2mNF40 MdaojZnEB/t+P1z4AQE9MXVXLB4hraFqeU0uHVMi5vlaf8AIFLhYyv+cZIK5xDe/Xsx8K1 hm0xaRGDeNDckDV0gDbc0Kjw8f1ImsrFQI7depgiVafDrdYL/uzpII9XxpK+nX/+EWeeIm Z0CARTeaH9yFHbzHfFFYbJb3xg+Q9qC4JzMZu0DrEA+Janr9WY84VtTGrRgsgKur7OhlcM 1SC+2MnfOrgTUDHypSDAtO6wf/TqUlVzKSTevAy5I/vX2jMviLiGaFphcwIG5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727267671; a=rsa-sha256; cv=none; b=I4jUiTRVuI8bCsY3kUF8pbG0NSeVndeR/xf2xlh1ombU7EI2yoJwrrFNMVlFPu/U+MfuER DxU+VxH1yvetGYZaffkVUkpxNCEdC1zhKxBcSJ95YvW1oOeooyEfh2BMRgZR0eYpEy+k6s 9p4kV++BFVeEKVKeoaeA39nl26cMJHtjkZjtWmZTFNKaajmCPkWI3e+LDji/6UqI4RtnN6 f9kO7+vIjRXGsAvA1FgcL0xQ4v05OOqqg6m8FkgHJvF9FiSVTTu1FOxdK9DBp0CEhQ2sxP ZdcGS/blZmgKDW+UiI4MAmx0Vn6jnf5JZJve+G814fVS9r3/YUEJz4sGBkqUGg== 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 4XDGPz0xF2z1CP2; Wed, 25 Sep 2024 12:34:31 +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 48PCYVxO071780; Wed, 25 Sep 2024 12:34:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48PCYVt6071777; Wed, 25 Sep 2024 12:34:31 GMT (envelope-from git) Date: Wed, 25 Sep 2024 12:34:31 GMT Message-Id: <202409251234.48PCYVt6071777@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: 85ea6992935c - main - pf tests: Make TCP port numbers configurable 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: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 85ea6992935ced034dea1c88755542c1b4969368 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=85ea6992935ced034dea1c88755542c1b4969368 commit 85ea6992935ced034dea1c88755542c1b4969368 Author: Kajetan Staszkiewicz AuthorDate: 2024-09-25 10:46:37 +0000 Commit: Kristof Provost CommitDate: 2024-09-25 10:46:48 +0000 pf tests: Make TCP port numbers configurable This will be useful for state maximums testing. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D46773 --- tests/sys/netpfil/common/pft_ping.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/sys/netpfil/common/pft_ping.py b/tests/sys/netpfil/common/pft_ping.py index 21b08c75a7da..befe757406be 100644 --- a/tests/sys/netpfil/common/pft_ping.py +++ b/tests/sys/netpfil/common/pft_ping.py @@ -123,7 +123,10 @@ def send_tcp_syn(dst_address, sendif, send_params): ip = prepare_ipv6(dst_address, send_params) else: ip = prepare_ipv4(dst_address, send_params) - tcp = sp.TCP(dport=666, flags='S', options=opts, seq=seq) + tcp = sp.TCP( + sport=send_params.get('sport'), dport=send_params.get('dport'), + flags='S', options=opts, seq=seq, + ) req = ether / ip / tcp sp.sendp(req, iface=sendif, verbose=False) @@ -439,6 +442,10 @@ def parse_args(): help='TCP Maximum Segment Size') parser_send.add_argument('--send-seq', type=int, help='TCP sequence number') + parser_send.add_argument('--send-sport', type=int, + help='TCP source port') + parser_send.add_argument('--send-dport', type=int, default=666, + help='TCP destination port') parser_send.add_argument('--send-length', type=int, default=len(PAYLOAD_MAGIC), help='ICMP Echo Request payload size') parser_send.add_argument('--send-tc', type=int, @@ -480,7 +487,10 @@ def main(): # missing from the command line, always fill the dictionaries with None. send_params = {} expect_params = {} - for param_name in ('flags', 'hlim', 'length', 'mss', 'seq', 'tc', 'frag_length'): + for param_name in ( + 'flags', 'hlim', 'length', 'mss', 'seq', 'tc', 'frag_length', + 'sport', 'dport', + ): param_arg = vars(args).get(f'send_{param_name}') send_params[param_name] = param_arg if param_arg else None param_arg = vars(args).get(f'expect_{param_name}')