Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Apr 2024 16:22:46 GMT
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 681711b77cde - main - uipc_socket: handle socket buffer locks in sopeeloff
Message-ID:  <202404051622.435GMkEe096461@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=681711b77cde2cf3d64dc1e4951ec8287bc4f3e8

commit 681711b77cde2cf3d64dc1e4951ec8287bc4f3e8
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2024-04-05 16:14:54 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2024-04-05 16:20:19 +0000

    uipc_socket: handle socket buffer locks in sopeeloff
    
    PR:                     278171
    Reviewed by:            markj
    Fixes:                  a4fc41423f7d ("sockets: enable protocol specific socket buffers")
    MFC after:              3 days
    Differential Revision:  https://reviews.freebsd.org/D44640
---
 sys/kern/uipc_socket.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 196461f645ce..82fbcd4a922d 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -922,6 +922,10 @@ sopeeloff(struct socket *head)
 	so->so_snd.sb_timeo = head->so_snd.sb_timeo;
 	so->so_rcv.sb_flags |= head->so_rcv.sb_flags & SB_AUTOSIZE;
 	so->so_snd.sb_flags |= head->so_snd.sb_flags & SB_AUTOSIZE;
+	if ((so->so_proto->pr_flags & PR_SOCKBUF) == 0) {
+		so->so_snd.sb_mtx = &so->so_snd_mtx;
+		so->so_rcv.sb_mtx = &so->so_rcv_mtx;
+	}
 
 	soref(so);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202404051622.435GMkEe096461>