From nobody Fri Nov 12 19:21:12 2021 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 CD994184C1A3; Fri, 12 Nov 2021 19:21:12 +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 4HrT2w5T2Xz3Q0d; Fri, 12 Nov 2021 19:21:12 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 9B895250C7; Fri, 12 Nov 2021 19:21:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ACJLCOR065783; Fri, 12 Nov 2021 19:21:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ACJLC8b065782; Fri, 12 Nov 2021 19:21:12 GMT (envelope-from git) Date: Fri, 12 Nov 2021 19:21:12 GMT Message-Id: <202111121921.1ACJLC8b065782@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 6913bf4c3d34 - main - tests/divert: fix after 2ce85919bbba (IP source address validation) 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: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6913bf4c3d34c8caf2d3e72f9c44b345486b8ceb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=6913bf4c3d34c8caf2d3e72f9c44b345486b8ceb commit 6913bf4c3d34c8caf2d3e72f9c44b345486b8ceb Author: Gleb Smirnoff AuthorDate: 2021-11-12 19:17:56 +0000 Commit: Gleb Smirnoff CommitDate: 2021-11-12 19:20:06 +0000 tests/divert: fix after 2ce85919bbba (IP source address validation) Just make the test packet more legitimate. Reviewed by: melifaro --- tests/sys/common/divert.py | 3 ++- tests/sys/netinet/divert.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/sys/common/divert.py b/tests/sys/common/divert.py index f23fbe857cbb..94e20a03571f 100755 --- a/tests/sys/common/divert.py +++ b/tests/sys/common/divert.py @@ -42,6 +42,7 @@ IPPROTO_DIVERT = 258 def parse_args(): parser = argparse.ArgumentParser(description='divert socket tester') parser.add_argument('--dip', type=str, help='destination packet IP') + parser.add_argument('--sip', type=str, help='source packet IP') parser.add_argument('--divert_port', type=int, default=6668, help='divert port to use') parser.add_argument('--test_name', type=str, required=True, @@ -65,7 +66,7 @@ def ipdivert_ip6_output_remote_success(args): def ipdivert_ip_input_local_success(args): """Sends IPv4 packet to OS stack as inbound local packet.""" - packet = sc.IP(dst=args.dip) / sc.ICMP(type='echo-request') + packet = sc.IP(dst=args.dip,src=args.sip) / sc.ICMP(type='echo-request') with socket.socket(socket.AF_INET, socket.SOCK_RAW, IPPROTO_DIVERT) as s: s.bind(('0.0.0.0', args.divert_port)) s.sendto(bytes(packet), (args.dip, 0)) diff --git a/tests/sys/netinet/divert.sh b/tests/sys/netinet/divert.sh index acd33742b791..3d064b9155b7 100755 --- a/tests/sys/netinet/divert.sh +++ b/tests/sys/netinet/divert.sh @@ -135,7 +135,8 @@ ipdivert_ip_input_local_success_body() { jexec ${jname} ifconfig ${epair}b inet ${ip4b}/30 atf_check -s exit:0 jexec ${jname} $(atf_get_srcdir)/${script_name} \ - --dip ${ip4b} --test_name ipdivert_ip_input_local_success + --sip ${ip4a} --dip ${ip4b} \ + --test_name ipdivert_ip_input_local_success count=`jexec ${jname} netstat -s -p icmp | grep 'Input histogram:' -A8 | grep -c 'echo: '` # Verify redirect got installed