From nobody Mon Feb 16 15:44:21 2026 X-Original-To: dev-commits-src-branches@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 4fF6X60gVPz6RxZR for ; Mon, 16 Feb 2026 15:44:22 +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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fF6X56Ztsz4P1Y for ; Mon, 16 Feb 2026 15:44:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771256662; 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=nFCxEMXUHTv4sA4uy4zZO2GaAp+YIbg5zbMxDTeVUfc=; b=WKzUaVtXbSlTpNjXZnmbbc6OUEgq6N2tUG8PYMnnKFFd9tk/ORxXOorrW++qbPm60vcB/0 1MTZhA68tlz867OkJuSqkaB+484idbOlatUNgM5DWT0TDAeKTVIS07PVwhWccz3HTes//z KD7nbNi7FzLYOZNV2S3ZijWt3G/owa+CRLX7UsE6M5LXK4Hm2P7NrpBwSOZoOAd4U2iCM2 iCbb5H0cUnt/CHx2qDZ3YwuickG5vqAEnmwrRDG21sYLs9Opu2MJW/8IH0vnYGAUa1tAAe T5CUzAh5NrQwPJGdLF9QCCkpeoHAhN3YiBAp5uI9aAmxiNonYdQ3YXgRUYYLCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1771256661; a=rsa-sha256; cv=none; b=Ltf3W89FTiolLxaE2NsxcPLs0NDLInnKcCLTvLpVUr2fbvU1vRiYiVBkuMfOyqkZUzi7qq 5fgijxUVr9+fRwmlQYun+ZLwr9DlSdCUgtZJehGYcrmOzkWfUXzWN2J0wh+WXBtW97oavI 1xfudaSMTGG+o0yNIfLyfYUYNZbhpws5Pxv2GluZoiw9hMq2BGSn0x7HFvNct/oDaGRUie x9aveW+D0tTSoHtb1sIZ879yYQKeUpZqyPRRbhd1quTj140mEGceB6JuYJZC5LiTLAxQX2 D0Vh0l71WN3LKMympsvMB3ltu+E8C8SD//j4pWfE/OZgEISBtePk3uCQDFZxww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771256661; 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=nFCxEMXUHTv4sA4uy4zZO2GaAp+YIbg5zbMxDTeVUfc=; b=jVleW7CXtNl3RE+On2mgSj5xHd6xckol0XuoapmF2QCiTrG6fF3mYpO6ECarZwANO4zrdE mReOIZ+dkS2iFGo3MOStLtxXsGqPfqxCDmYH/zcTNNVBBh+K/+n2mcgJS7twvJfgeflSXN fPV07TRG02q6kqO8+EfrF6/FyXC5LI5VSi7hMMurdN/wN+xVGhcThDIYWuiQOzGosZtcs0 FHfiYh5v3Meansom6/UAfhDbIM1UVcS5AXzSD1FGhLjo9Mntt4PiwdyYnFdR31op1mfqOG y0Pneb78x69CQaW5paMy9LZgvzzBUp7Jj4M2kQN0AAbc5SfD4BBowV0bA00zBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fF6X56BYszTdL for ; Mon, 16 Feb 2026 15:44:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1f13a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 16 Feb 2026 15:44:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 12f619de32cc - stable/15 - divert: Update divert.4 to mention pf List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 12f619de32cc5988031f0bb384711d5653ed7176 Auto-Submitted: auto-generated Date: Mon, 16 Feb 2026 15:44:21 +0000 Message-Id: <69933b55.1f13a.2d262561@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=12f619de32cc5988031f0bb384711d5653ed7176 commit 12f619de32cc5988031f0bb384711d5653ed7176 Author: Mark Johnston AuthorDate: 2026-01-27 13:48:22 +0000 Commit: Mark Johnston CommitDate: 2026-02-16 13:42:10 +0000 divert: Update divert.4 to mention pf pf's divert-to action can be used to pass packets to a divert socket, but divert.4 didn't mention this, only referencing ipfw. Try to make the text a bit more general. Reviewed by: igoro, kp, glebius MFC after: 2 weeks Sponsored by: OPNsense Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D54848 (cherry picked from commit 120c0bb833977707fc56f59b0961994fbd6c52e7) --- share/man/man4/divert.4 | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/share/man/man4/divert.4 b/share/man/man4/divert.4 index 5732099bd447..647bb72ab49b 100644 --- a/share/man/man4/divert.4 +++ b/share/man/man4/divert.4 @@ -1,5 +1,5 @@ .\" -.Dd August 30, 2022 +.Dd January 23, 2026 .Dt DIVERT 4 .Os .Sh NAME @@ -15,7 +15,6 @@ To enable support for divert sockets, place the following lines in the kernel configuration file: .Bd -ragged -offset indent -.Cd "options IPFIREWALL" .Cd "options IPDIVERT" .Ed .Pp @@ -25,14 +24,15 @@ as a module at boot time, add the following lines into the .Xr loader.conf 5 file: .Bd -literal -offset indent -ipfw_load="YES" ipdivert_load="YES" .Ed .Sh DESCRIPTION Divert sockets allow to intercept and re-inject packets flowing through the .Xr ipfw 4 -firewall. +and +.Xr pf 4 +firewalls. A divert socket can be bound to a specific .Nm port via the @@ -43,13 +43,15 @@ desired value. Note that the .Nm port has nothing to do with TCP/UDP ports. -It is just a cookie number, that allows to differentiate between different -divert points in the +It is just a cookie whose value depends on the firewall in use. +For .Xr ipfw 4 -ruleset. +this is the number of the rule which diverted the packet; for +.Xr pf 4 +this is a value which indicates the original direction through the +firewall of the diverted packet. A divert socket bound to a divert port will receive all packets diverted -to that port by -.Xr ipfw 4 . +to that port by the firewall. Packets may also be written to a divert port, in which case they re-enter firewall processing at the next rule. .Pp @@ -67,8 +69,8 @@ Diverted packets may be read unaltered via or .Xr recvfrom 2 . In the latter case, the address returned will have its port set to -some tag supplied by the packet diverter, (usually the ipfw rule number) -and the IP address set to the (first) address of +some tag supplied by the packet diverter, (usually the cookie described +above) and the IP address set to the (first) address of the interface on which the packet was received (if the packet was incoming) or .Dv INADDR_ANY @@ -179,6 +181,7 @@ that was not associated with any interface. .Xr sendto 2 , .Xr socket 2 , .Xr ipfw 4 , +.Xr pf 4 , .Xr ipfw 8 .Sh AUTHORS .An Archie Cobbs Aq Mt archie@FreeBSD.org , @@ -186,8 +189,7 @@ Whistle Communications Corp. .Sh BUGS This is an attempt to provide a clean way for user mode processes to implement various IP tricks like address translation, but it -could be cleaner, and it is too dependent on -.Xr ipfw 8 . +could be cleaner. .Pp It is questionable whether incoming fragments should be reassembled before being diverted.