git: 7b76afd6c211 - stable/15 - netipsec: Implement pr_disconnect for PF_KEY sockets
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 07 Sep 2026 15:07:53 UTC
The branch stable/15 has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=7b76afd6c211ee6a5881bfe37d5f91097a171f6d
commit 7b76afd6c211ee6a5881bfe37d5f91097a171f6d
Author: Ryan Campbell <rycampbell@qnx.com>
AuthorDate: 2026-08-27 15:05:39 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-09-07 12:59:27 +0000
netipsec: Implement pr_disconnect for PF_KEY sockets
Otherwise close() fails.
PR: 297977
Reviewed by: glebius
Fixes: ea7be1293b48 ("keysock: do not use raw socket code")
MFC after: 1 week
(cherry picked from commit fef9077cf816a6499bd6a7f9678c179194463e43)
---
sys/netipsec/keysock.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/sys/netipsec/keysock.c b/sys/netipsec/keysock.c
index 23c155ed6aff..ee3ab9741a88 100644
--- a/sys/netipsec/keysock.c
+++ b/sys/netipsec/keysock.c
@@ -308,6 +308,12 @@ key_detach(struct socket *so)
so->so_pcb = NULL;
}
+static int
+key_disconnect(struct socket *so)
+{
+ return (ENOTCONN);
+}
+
static int
key_shutdown(struct socket *so, enum shutdown_how how)
{
@@ -340,6 +346,7 @@ static struct protosw keysw = {
.pr_abort = key_close,
.pr_attach = key_attach,
.pr_detach = key_detach,
+ .pr_disconnect = key_disconnect,
.pr_send = key_send,
.pr_shutdown = key_shutdown,
.pr_close = key_close,