git: 1a3d1be4965a - main - ng_ksocket: use new macros to lock socket buffers
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 23 Mar 2024 05:45:41 UTC
The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=1a3d1be4965afddded0b2582b9c4969c1e6a4129 commit 1a3d1be4965afddded0b2582b9c4969c1e6a4129 Author: Gleb Smirnoff <glebius@FreeBSD.org> AuthorDate: 2024-03-23 05:44:16 +0000 Commit: Gleb Smirnoff <glebius@FreeBSD.org> CommitDate: 2024-03-23 05:44:16 +0000 ng_ksocket: use new macros to lock socket buffers --- sys/netgraph/ng_ksocket.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/netgraph/ng_ksocket.c b/sys/netgraph/ng_ksocket.c index 388fe9557db3..3e4427f9e387 100644 --- a/sys/netgraph/ng_ksocket.c +++ b/sys/netgraph/ng_ksocket.c @@ -608,12 +608,12 @@ ng_ksocket_connect(hook_p hook) struct socket *const so = priv->so; /* Add our hook for incoming data and other events */ - SOCKBUF_LOCK(&priv->so->so_rcv); + SOCK_RECVBUF_LOCK(so); soupcall_set(priv->so, SO_RCV, ng_ksocket_incoming, node); - SOCKBUF_UNLOCK(&priv->so->so_rcv); - SOCKBUF_LOCK(&priv->so->so_snd); + SOCK_RECVBUF_UNLOCK(so); + SOCK_SENDBUF_LOCK(so); soupcall_set(priv->so, SO_SND, ng_ksocket_incoming, node); - SOCKBUF_UNLOCK(&priv->so->so_snd); + SOCK_SENDBUF_UNLOCK(so); SOCK_LOCK(priv->so); priv->so->so_state |= SS_NBIO; SOCK_UNLOCK(priv->so); @@ -1231,12 +1231,12 @@ ng_ksocket_accept(priv_p priv) */ LIST_INSERT_HEAD(&priv->embryos, priv2, siblings); - SOCKBUF_LOCK(&so->so_rcv); + SOCK_RECVBUF_LOCK(so); soupcall_set(so, SO_RCV, ng_ksocket_incoming, node); - SOCKBUF_UNLOCK(&so->so_rcv); - SOCKBUF_LOCK(&so->so_snd); + SOCK_RECVBUF_UNLOCK(so); + SOCK_SENDBUF_LOCK(so); soupcall_set(so, SO_SND, ng_ksocket_incoming, node); - SOCKBUF_UNLOCK(&so->so_snd); + SOCK_SENDBUF_UNLOCK(so); /* Fill in the response data and send it or return it to the caller */ resp_data = (struct ng_ksocket_accept *)resp->data;