summaryrefslogtreecommitdiffstats
path: root/sys/sys/protosw.h
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2006-04-01 15:42:02 +0000
committerrwatson <rwatson@FreeBSD.org>2006-04-01 15:42:02 +0000
commit5479e5d69217e0a6876338fc7cde604067b679ca (patch)
tree7431f8c0d78c14bc446d524dcda6a00888732015 /sys/sys/protosw.h
parent68ff3be0b395955e8feac72262824b90a155a710 (diff)
downloadFreeBSD-src-5479e5d69217e0a6876338fc7cde604067b679ca.zip
FreeBSD-src-5479e5d69217e0a6876338fc7cde604067b679ca.tar.gz
Chance protocol switch method pru_detach() so that it returns void
rather than an error. Detaches do not "fail", they other occur or the protocol flags SS_PROTOREF to take ownership of the socket. soclose() no longer looks at so_pcb to see if it's NULL, relying entirely on the protocol to decide whether it's time to free the socket or not using SS_PROTOREF. so_pcb is now entirely owned and managed by the protocol code. Likewise, no longer test so_pcb in other socket functions, such as soreceive(), which have no business digging into protocol internals. Protocol detach routines no longer try to free the socket on detach, this is performed in the socket code if the protocol permits it. In rts_detach(), no longer test for rp != NULL in detach, and likewise in other protocols that don't permit a NULL so_pcb, reduce the incidence of testing for it during detach. netinet and netinet6 are not fully updated to this change, which will be in an upcoming commit. In their current state they may leak memory or panic. MFC after: 3 months
Diffstat (limited to 'sys/sys/protosw.h')
-rw-r--r--sys/sys/protosw.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/sys/protosw.h b/sys/sys/protosw.h
index 5f39c69..760aa7e 100644
--- a/sys/sys/protosw.h
+++ b/sys/sys/protosw.h
@@ -206,7 +206,7 @@ struct pr_usrreqs {
int (*pru_connect2)(struct socket *so1, struct socket *so2);
int (*pru_control)(struct socket *so, u_long cmd, caddr_t data,
struct ifnet *ifp, struct thread *td);
- int (*pru_detach)(struct socket *so);
+ void (*pru_detach)(struct socket *so);
int (*pru_disconnect)(struct socket *so);
int (*pru_listen)(struct socket *so, int backlog,
struct thread *td);
@@ -256,7 +256,7 @@ int pru_connect_notsupp(struct socket *so, struct sockaddr *nam,
int pru_connect2_notsupp(struct socket *so1, struct socket *so2);
int pru_control_notsupp(struct socket *so, u_long cmd, caddr_t data,
struct ifnet *ifp, struct thread *td);
-int pru_detach_notsupp(struct socket *so);
+void pru_detach_notsupp(struct socket *so);
int pru_disconnect_notsupp(struct socket *so);
int pru_listen_notsupp(struct socket *so, int backlog, struct thread *td);
int pru_peeraddr_notsupp(struct socket *so, struct sockaddr **nam);
OpenPOWER on IntegriCloud