From 86ed17d675cb503ddb3f71f8b6f7c3af530bb29a Mon Sep 17 00:00:00 2001 From: dillon Date: Sat, 17 Nov 2001 03:07:11 +0000 Subject: Give struct socket structures a ref counting interface similar to vnodes. This will hopefully serve as a base from which we can expand the MP code. We currently do not attempt to obtain any mutex or SX locks, but the door is open to add them when we nail down exactly how that part of it is going to work. --- sys/kern/uipc_socket2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/kern/uipc_socket2.c') diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index c969e7d..122fcda 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -210,6 +210,8 @@ sodropablereq(head) * then we allocate a new structure, propoerly linked into the * data structure of the original socket, and return this. * Connstatus may be 0, or SO_ISCONFIRMING, or SO_ISCONNECTED. + * + * note: the ref count on the socket is 0 on return */ struct socket * sonewconn(head, connstatus) @@ -246,7 +248,7 @@ sonewconn3(head, connstatus, td) so->so_cred = crhold(head->so_cred); if (soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat) || (*so->so_proto->pr_usrreqs->pru_attach)(so, 0, NULL)) { - sodealloc(so); + sotryfree(so); return ((struct socket *)0); } -- cgit v1.1