From nobody Tue Jan 27 14:05:05 2026 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 4f0nGn2zvWz6Pslr for ; Tue, 27 Jan 2026 14:05:05 +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 4f0nGn1g8vz3qn2 for ; Tue, 27 Jan 2026 14:05:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769522705; 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=B2e9/plCISc/D72fPMCSAlIpxH4+LY4FsduBRg0CP9I=; b=LEBXN0PBwDQu0B09rYREbK4UFkKc93PcZnFnzjxrMYES9JP4auBdLho8zf7VpYUp/otdIm LPDAsH3XBq6N9MpXmAuyJ4/yco35KAx5lYAjYKIL/uhY8hf1N3e9DqiIHMbOrV5T/eQ4cY /V20odMA9ozeNsnHvxvO7iOfw7mziV5gopEYBwNyF+m2oJjy1ZufjSDjL51yiL6Hm2N4am SUeHejnEinsEMJiVeRk5Hoe+FDT5+K5KKoJrBSTNGag+fTQZ3ckZmmYkljr8vq9WKBTjCx IJW3hRpek155Ll18HTtU1lbuD2+G3h7rKzamWdzHxs/RWG6e0uw1b970KE/h6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769522705; 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=B2e9/plCISc/D72fPMCSAlIpxH4+LY4FsduBRg0CP9I=; b=gXR/QgMskP0H5bYtpTelrYHO+95PcnCmHjRJ6kBorEj2SwyKIz40jU/psdjcvB+TbSj7fZ H2OCeUhEq0Qf5dPSehYPUmy0OZGx2+dV9db8vpgnEo2ALbXKnGjc/Z7b9RtFa16wvfE//g zM7mO/WVZHx7djTYtB7c688qk4O4IK0t+zmroCmAKgGf0eoLkkE0RhzDJSTzpfcNPNKYUJ uKgqBJ+cFXJSm4ZPP2ZzCFvNnGV3yS3uElo6liBoeZjnHSDnJBjgK2eZLJUCUvf48U0R7U GWXjmLKg8Yd05yMhzqfpw0NF+pImGc0LiEE6yOv83u9J66bHhWallsaHzYUbZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1769522705; a=rsa-sha256; cv=none; b=wdVS8n434Ertw1NoMnU3XJQILUV6JsMXfMDw4dVDBaCPYCRsBO/8Php8XVYNEwJrDM5ZD5 OxRzG5W+lNSPteOajlpRxxdgejH5uLwRlU0tiavdhjlMmMIqPfr4Yt082Fb9BtfCZw9L+E 4Q3k9k4u/ifHK2pqE84PTcCWVRhYkPmg19fgMkkQTM4ja9TKB9yT+f+KllVjd+sk2CQM+8 obtNs1ahQcFeMYk4X3PLJkVD3zZgB6jvoN6QRZlNSh5TnmJw6SxCqve51xJCPU8p5GJCOG /rErFw4jNmd72mRUJKboAK2UyIQw4iOYshYYZKoIHQ/X0OJKmw4cuKc15TBJsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f0nGn1D4Qz17RQ for ; Tue, 27 Jan 2026 14:05:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22bee by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 27 Jan 2026 14:05:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 120c0bb83397 - main - divert: Update divert.4 to mention pf 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: 120c0bb833977707fc56f59b0961994fbd6c52e7 Auto-Submitted: auto-generated Date: Tue, 27 Jan 2026 14:05:05 +0000 Message-Id: <6978c611.22bee.3b1da9ab@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=120c0bb833977707fc56f59b0961994fbd6c52e7 commit 120c0bb833977707fc56f59b0961994fbd6c52e7 Author: Mark Johnston AuthorDate: 2026-01-27 13:48:22 +0000 Commit: Mark Johnston CommitDate: 2026-01-27 14:04:48 +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 --- 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.