From nobody Thu May 12 19:58:17 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 ADA351ADEC32; Thu, 12 May 2022 19:58:18 +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 4KzjJB1PCsz4YSy; Thu, 12 May 2022 19:58:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652385498; 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=ENQRINR3Z7FcosMehEx4kCOP1rRVqvk2f2fLGTdUmDs=; b=UIF45ZYftsukScBNcDu1HQqdIgQM11r80XBj/PpS5knW1Av3vkdjZnMDA0PTq536cmLjIs OJU6YNQwFFIpWnIMJxJIyCZpZQmGNN25lz4n5dDvO2HWcaBh0Gbl0oHLL+jngiCNMoY9zo hnGRVxPl63ZhjCmer7G0cfZ9jkoTLPH8xOx765UulUdHIjF67MPsRonzyTH0CQCI2AuSXc tUThMtI9HNYEnKe1sCSLZfi4LU1SOfkHm5obLlkxrQL2PZvNPKDui/QoIB8KgffBKvXnu4 HaFz7bSPaxPLzWfkXP1AW0xaYnGLRuLCM/vQTqBz8jQfvLqBk+tAcyrBFe3wxw== 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 844A414873; Thu, 12 May 2022 19:58:17 +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 24CJwHif075659; Thu, 12 May 2022 19:58:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24CJwHuM075658; Thu, 12 May 2022 19:58:17 GMT (envelope-from git) Date: Thu, 12 May 2022 19:58:17 GMT Message-Id: <202205121958.24CJwHuM075658@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: 009e8f0a1099 - main - pf: fix pf_rule_to_actions() 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: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 009e8f0a109999a1978ac77b390f4ac5a6ae59a3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652385498; 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=ENQRINR3Z7FcosMehEx4kCOP1rRVqvk2f2fLGTdUmDs=; b=vHGL3uxbduXBt2HO0Kh7UtB7igz8RHXyXGMmEe7VLbdJI4Y5IEBO2Yoxm0GMh2V835YQ7K gUvFJfwiFvqdwjlDFlYGMmjVytdzrs9hiscqF6b3wkg3cQsgmEAWbEQXeYlMW3ofvAfh6G Fgvl7QFdQLUt8wBxzGzoYnnFqTgO1VlPX85KxxhpszVThAOSbxoFV7K5dVns3iZJnFfJgK G8yiAZZ28H/NJz8umDqgdjcYVUfrkXfn7B8gPZw59ktS2wQ/IYyIvO0+Fyw9Yvfz7lMav2 JN4rwiFOnw87p/49G/Ur+WDctdOGcdFV79usqT2PKQTgTrEUjfzMXY/c+WCvKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652385498; a=rsa-sha256; cv=none; b=NiQojU5nQnxvzoIDV6eQ4PA2EmUIbh4gzWLSF/h9uT23UKv6aYNMaAvqfRhbtwaZfuvyWB 5rBywi01JbysbKxYTJC9/Qdhfgcr3JTibadFXwoeffrUHEvQgupHBgFFvIqoOdLFkaCABf 8q6MC9Cxt0Q/mqyz8bF7KNbBEbh1kFG0rl9RyBLw7UcdHAQ0YcswS8Bn2NanKfBelhgkAZ 0ECuNtPDB2AFb/OKvVXmcjptLwJuhHGj/0UdQxMFUrGcugQ7jbWOANwd9bkzWleHW8gSXy BppKM9wKX3F0+3Eo2IfekPzlpX/W/YMRR9uKey46uBoPnc1t9Oi+1p81cG8IhA== 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=009e8f0a109999a1978ac77b390f4ac5a6ae59a3 commit 009e8f0a109999a1978ac77b390f4ac5a6ae59a3 Author: Kristof Provost AuthorDate: 2022-05-11 16:51:21 +0000 Commit: Kristof Provost CommitDate: 2022-05-12 19:50:10 +0000 pf: fix pf_rule_to_actions() If we already had a pipe set in the actions struct we need to take care to clear the flag if we're overwriting it with a queue. This can happen if we've got Ethernet rules setting a dummynet pipe. It does this indirectly, by adding the dummynet information to a pf_mtag associated with the mbuf. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index bd9334982be9..5b3bc719ecb6 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -3582,8 +3582,12 @@ pf_rule_to_actions(struct pf_krule *r, struct pf_rule_actions *a) a->dnpipe = r->dnpipe; if (r->dnrpipe) a->dnrpipe = r->dnrpipe; - if (r->free_flags & PFRULE_DN_IS_PIPE) - a->flags |= PFRULE_DN_IS_PIPE; + if (r->dnpipe || r->dnrpipe) { + if (r->free_flags & PFRULE_DN_IS_PIPE) + a->flags |= PFRULE_DN_IS_PIPE; + else + a->flags &= ~PFRULE_DN_IS_PIPE; + } } int