From nobody Tue Aug 30 23:24:58 2022 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 4MHNgt3Bx0z4bYL6; Tue, 30 Aug 2022 23:24:58 +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 4MHNgt2WgNz3qlk; Tue, 30 Aug 2022 23:24:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661901898; 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=Ob7Xdx2Dtr53Wr33grtsC356lY71mabZuBBeYyKes9g=; b=vpEDB1yojqh/zl9yp5pbcQdOB+tg80h/+ANt5tC2gBXWR34jtUOadp1nw8slQ0mmOCtLe1 WTO0Jx5+53SgZYrQFRFBp1yxwnaATovuY8EvyFfkx9T1Hy8MUmiw5bX6qGuM2gzPZFjlWh ZE2Ptbn9X5W8GS/ntFBcDIEt8DX2ToaOwpqUN0cYc8++OiCMoec6XcRF/i1XKuARDXK8Zc 3D0g49blRd+tRzAYdgV8+1hifU7mPlkpS683sEaErIqmOxpGzsgq+34Bx7MlJZBAZAMbpN ySpy+BbC+4ZY0D1SWzaqN47AATKrxrrP87ceR4u6NdxnNzDV5ulfKnte2cV1Hg== 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 4MHNgt1W77zwnj; Tue, 30 Aug 2022 23:24:58 +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 27UNOwb8073231; Tue, 30 Aug 2022 23:24:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27UNOwfN073230; Tue, 30 Aug 2022 23:24:58 GMT (envelope-from git) Date: Tue, 30 Aug 2022 23:24:58 GMT Message-Id: <202208302324.27UNOwfN073230@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: 4627bc1e90fd - main - tests: use PF_DIVERT/SOCK_RAW instead of PF_INET/SOCK_RAW/IPPROTO_DIVERT 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 4627bc1e90fd17c8d4f44de6b932d456b67661fc Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661901898; 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=Ob7Xdx2Dtr53Wr33grtsC356lY71mabZuBBeYyKes9g=; b=l2IvwwIs2uwyGxuv0g2BsLd2mP9RCsNQrC4MFMwAYJZY+mAO+LGkmKsmQum5Nw0Sm1DO9B e7gfBTvJykj+8ErbYFTpQa1hqkaCDtbtQ0ekwPXHUlq1AfMsXtJV5yLZUQ4PQ5OoFw513W H6gC5xxnAA0tNv9P89v6HAL4ZrKIQt2MgLkC532erGiWDwsz4YhMA7ccgygx6EqLzsmqkS mAEFh3KzpH2DUZMZyqEr2puSq3huZmj9cGVKRWQDJkH7vKA2XeIKF9jB14a7yzNcQKItX+ Mx5F29SZGbuE8dkKWbvB4GXZ7UgP4Vav2LEy1kznknNbXJLtBE8amFZMu83XyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661901898; a=rsa-sha256; cv=none; b=uS6rCioow1RwqpNVPpaXs8pU6e10PwVB3BAHGoaYbHvaLiQs0VpTYOc9RONhThxfi7jUGE GiiNGb8PZc/bPXhiir8wdwmnD23PHv1gG8mEx89nGZNszmPUAPsAKGT0Vi/nVMgsKzAj4u gZQmT/OAy6dQad3YXa7ZNeeGD+Ot8oNCVzMXPhD3+/pnkY8zjTvsKGg2eycr58IONi/YR5 KCGL4JVqY+bVYdFkG4kDqHUVPeRLPPcqQxJzEIiEDDy8vSTa9a9BmNmYIwIlGXAwF+KR2V 0OWPLAW5/cSw5I51Xs5tXdhP8GtZXkfaEPWDp+hUg/X2RBf6fPVD/y/4Q0IUmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=4627bc1e90fd17c8d4f44de6b932d456b67661fc commit 4627bc1e90fd17c8d4f44de6b932d456b67661fc Author: Gleb Smirnoff AuthorDate: 2022-08-30 23:23:36 +0000 Commit: Gleb Smirnoff CommitDate: 2022-08-30 23:24:37 +0000 tests: use PF_DIVERT/SOCK_RAW instead of PF_INET/SOCK_RAW/IPPROTO_DIVERT --- tests/sys/common/divert.py | 8 ++++---- tools/regression/netinet/ipdivert/ipdivert.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/sys/common/divert.py b/tests/sys/common/divert.py index 94e20a03571f..44b1f49ae13f 100755 --- a/tests/sys/common/divert.py +++ b/tests/sys/common/divert.py @@ -36,7 +36,7 @@ import scapy.all as sc import argparse -IPPROTO_DIVERT = 258 +PF_DIVERT = 44 def parse_args(): @@ -52,14 +52,14 @@ def parse_args(): def ipdivert_ip_output_remote_success(args): packet = sc.IP(dst=args.dip) / sc.ICMP(type='echo-request') - with socket.socket(socket.AF_INET, socket.SOCK_RAW, IPPROTO_DIVERT) as s: + with socket.socket(PF_DIVERT, socket.SOCK_RAW, 0) as s: s.bind(('0.0.0.0', args.divert_port)) s.sendto(bytes(packet), ('0.0.0.0', 0)) def ipdivert_ip6_output_remote_success(args): packet = sc.IPv6(dst=args.dip) / sc.ICMPv6EchoRequest() - with socket.socket(socket.AF_INET, socket.SOCK_RAW, IPPROTO_DIVERT) as s: + with socket.socket(PF_DIVERT, socket.SOCK_RAW, 0) as s: s.bind(('0.0.0.0', args.divert_port)) s.sendto(bytes(packet), ('0.0.0.0', 0)) @@ -67,7 +67,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,src=args.sip) / sc.ICMP(type='echo-request') - with socket.socket(socket.AF_INET, socket.SOCK_RAW, IPPROTO_DIVERT) as s: + with socket.socket(PF_DIVERT, socket.SOCK_RAW, 0) as s: s.bind(('0.0.0.0', args.divert_port)) s.sendto(bytes(packet), (args.dip, 0)) diff --git a/tools/regression/netinet/ipdivert/ipdivert.c b/tools/regression/netinet/ipdivert/ipdivert.c index 0d5849159a9a..37babd68f5f3 100644 --- a/tools/regression/netinet/ipdivert/ipdivert.c +++ b/tools/regression/netinet/ipdivert/ipdivert.c @@ -76,7 +76,7 @@ ipdivert_create(const char *test) { int s; - s = socket(PF_INET, SOCK_RAW, IPPROTO_DIVERT); + s = socket(PF_DIVERT, SOCK_RAW, 0); if (s < 0) fail(test, "socket"); return (s);