aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2024-02-28 23:57:04 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2024-02-28 23:57:25 +0000
commit7ee47c3bb7a6d85744e2747ec969161eed5bbaab (patch)
treee9d0d30f5a7a71bc6da676e005b94cb992a0a204
parent882d9f4507a8fa518a967aeebd88585fb1e19a85 (diff)
downloadsrc-7ee47c3bb7a6d85744e2747ec969161eed5bbaab.tar.gz
src-7ee47c3bb7a6d85744e2747ec969161eed5bbaab.zip
sockets: in solisten_proto() don't call sbdestroy() on a PR_SOCKBUF
A socket marked with PR_SOCKBUF has protocol specific socket buffers and will take care of the in its pr_listen method. Right now we don't have any sockets that can listen and are PR_SOCKBUF, but that will change soon.
-rw-r--r--sys/kern/uipc_socket.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index b647766cf258..18ecf1409fd7 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1063,8 +1063,10 @@ solisten_proto(struct socket *so, int backlog)
sbrcv_timeo = so->so_rcv.sb_timeo;
sbsnd_timeo = so->so_snd.sb_timeo;
- sbdestroy(so, SO_SND);
- sbdestroy(so, SO_RCV);
+ if (!(so->so_proto->pr_flags & PR_SOCKBUF)) {
+ sbdestroy(so, SO_SND);
+ sbdestroy(so, SO_RCV);
+ }
#ifdef INVARIANTS
bzero(&so->so_rcv,