summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2006-03-15 12:45:35 +0000
committerrwatson <rwatson@FreeBSD.org>2006-03-15 12:45:35 +0000
commitfe52c3f9d13b8d5d9360b5a2c313adb29d5f2568 (patch)
tree7febfb8ca0e465e5d4ec669056b8f7b40a864ebe
parentca3dcadafa770c452b90dc4d96ecdb7eebdb1937 (diff)
downloadFreeBSD-src-fe52c3f9d13b8d5d9360b5a2c313adb29d5f2568.zip
FreeBSD-src-fe52c3f9d13b8d5d9360b5a2c313adb29d5f2568.tar.gz
As with socket consumer references (so_count), make sofree() return
without GC'ing the socket if a strong protocol reference to the socket is present (SS_PROTOREF).
-rw-r--r--sys/kern/uipc_socket.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 0ccd1ef..561bafd 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1,8 +1,8 @@
/*-
- * Copyright (c) 2004 The FreeBSD Foundation
- * Copyright (c) 2004-2005 Robert N. M. Watson
* Copyright (c) 1982, 1986, 1988, 1990, 1993
* The Regents of the University of California. All rights reserved.
+ * Copyright (c) 2004 The FreeBSD Foundation
+ * Copyright (c) 2004-2006 Robert N. M. Watson
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -346,7 +346,7 @@ sofree(so)
SOCK_LOCK_ASSERT(so);
if (so->so_pcb != NULL || (so->so_state & SS_NOFDREF) == 0 ||
- so->so_count != 0) {
+ so->so_count != 0 || (so->so_state & SS_PROTOREF)) {
SOCK_UNLOCK(so);
ACCEPT_UNLOCK();
return;
OpenPOWER on IntegriCloud