From nobody Fri Jul 01 12:40:32 2022 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 8A5838706EB; Fri, 1 Jul 2022 12:40:32 +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 4LZFD03SBVz3vMv; Fri, 1 Jul 2022 12:40:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656679232; 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=WHyZ6VJbuVHpoZbfxFXQ37fF3z+Y39qMIdX99gjDdOs=; b=CqpEgt49NGHaq8jiR3LJuoMn0ONUqdA3OAPK6CDIGm6kxCj8zT2HYk4WcJ7+c/Luy0nn39 19LhNEDzHn4XGSkFzQaZ+W84MLwUiuCOkzmqLDSQmzOLzZHRqtA8LHYz/uiRd9HqtJvrTU +jWypZbB8zlCWl68m2GvBZyAZpVyA6atRTMtBfH2EqUqQd3d7O4oiWxp7UjpWlMotoX5qX PIkU+JubzprSUu1fE/VdFfY9r5bOVUIph5qL7IhNi69W9q4JKW9G7P4W6k349GhqsUdZco 15KpV38EDzCMU9Fc5oVJUNPcgVtxIMkZhrRUedN+8Rwe7qChgC0F3zkd8sy0pw== 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 56F1D1B963; Fri, 1 Jul 2022 12:40:32 +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 261CeWfR075611; Fri, 1 Jul 2022 12:40:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 261CeWq7075610; Fri, 1 Jul 2022 12:40:32 GMT (envelope-from git) Date: Fri, 1 Jul 2022 12:40:32 GMT Message-Id: <202207011240.261CeWq7075610@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: ba3b6b938db7 - main - pf: handle dummynet for non-IP packets 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: ba3b6b938db71a18a93cf88979af0e57136787bd Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656679232; 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=WHyZ6VJbuVHpoZbfxFXQ37fF3z+Y39qMIdX99gjDdOs=; b=EmSd2yoW+lrzTs4fARUufHbd05Fojlr5ukeonWSi1cbUlmABbLuSD5qbTDHG8FktTPlRBN 8pSvwC1cK+yb5PKNSrXx6WJwoEEz504AhLhJLS11MFun1I1N8L7Ev3zq01O0G1jTTB2OCJ PuRELEezrrzCIE1d3yhzBYOZ1IIsBMEPnYJhnbD74UwrP6Cxg0pUHoH4zPSkO0/kaEVCEp ZgI8f1SI1BSyuA835JrCTvFnegrkqzbERRyG9yIAqTlavdkk6O/UKWaLDYza//ANIjYyZ3 kTGUgqHuQylqLX8XZECbs49OqtFFoWL6nP3y51WDXtgurtW6JH4UcoW5zwGKKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656679232; a=rsa-sha256; cv=none; b=Zb4bAyu2azkecKBr37mfaiPipivYK55TQ01xDdGxu0lQaEzG76u/ia0JsDniroGsAIiqcs v/Bn7fGeWluZl8B7NZ515/1rw7S3nxSvuLevYVaPIymVejssjm9WvjeBMC5U2CmoqG5Omy MwOM4pqw38wSsMIdQLVgKF5nR+SU/hlVZtj2CKMAQC96mk98g4uOWftRjwxK/TGwLWDDYa vM8GpR3GV5EZx0vfwE3Z/GtkJxMpRnvLc+oV6gsXzcLZ+KJeB29MGG25SUmhrij4YWH8/M oTJ2ZhVZq0Y7iJ5KIikxB88k8RiFL1pVoq6OGrudwF+wJVM4p76/pditvNdLng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ba3b6b938db71a18a93cf88979af0e57136787bd commit ba3b6b938db71a18a93cf88979af0e57136787bd Author: Kristof Provost AuthorDate: 2022-07-01 11:13:20 +0000 Commit: Kristof Provost CommitDate: 2022-07-01 12:31:57 +0000 pf: handle dummynet for non-IP packets Do not panic if we try to dummynet an Ethernet packet that's not IPv4 or IPv6. Simply give it to dummynet. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 2 -- tests/sys/netpfil/pf/ether.sh | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index d9664404e6e3..d82ec5eafd3c 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -4094,8 +4094,6 @@ pf_test_eth_rule(int dir, struct pfi_kkif *kif, struct mbuf **m0) dnflow.f_id.src_ip6 = src->v6; dnflow.f_id.dst_ip6 = dst->v6; break; - default: - panic("Unknown address family"); } mtag->flags |= PF_TAG_DUMMYNET; diff --git a/tests/sys/netpfil/pf/ether.sh b/tests/sys/netpfil/pf/ether.sh index 549fbf22ab7b..7fd55a5d78b5 100644 --- a/tests/sys/netpfil/pf/ether.sh +++ b/tests/sys/netpfil/pf/ether.sh @@ -419,6 +419,9 @@ dummynet_body() pft_set_rules alcatraz \ "ether pass in dnpipe 1" + # Ensure things don't break if non-IP(v4/v6) traffic hits dummynet + arp -d 192.0.2.2 + # single ping succeeds just fine atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2