diff options
author | rwatson <rwatson@FreeBSD.org> | 2006-04-01 15:42:02 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2006-04-01 15:42:02 +0000 |
commit | 5479e5d69217e0a6876338fc7cde604067b679ca (patch) | |
tree | 7431f8c0d78c14bc446d524dcda6a00888732015 /sys/netnatm | |
parent | 68ff3be0b395955e8feac72262824b90a155a710 (diff) | |
download | FreeBSD-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/netnatm')
-rw-r--r-- | sys/netnatm/natm.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/netnatm/natm.c b/sys/netnatm/natm.c index 6b3b202..8b87694 100644 --- a/sys/netnatm/natm.c +++ b/sys/netnatm/natm.c @@ -74,7 +74,7 @@ struct mtx natm_mtx; * user requests */ static int natm_usr_attach(struct socket *, int, d_thread_t *); -static int natm_usr_detach(struct socket *); +static void natm_usr_detach(struct socket *); static int natm_usr_connect(struct socket *, struct sockaddr *, d_thread_t *); static int natm_usr_disconnect(struct socket *); static int natm_usr_shutdown(struct socket *); @@ -111,7 +111,7 @@ out: return (error); } -static int +static void natm_usr_detach(struct socket *so) { struct natmpcb *npcb; @@ -122,7 +122,6 @@ natm_usr_detach(struct socket *so) npcb_free(npcb, NPCB_DESTROY); /* drain */ so->so_pcb = NULL; NATM_UNLOCK(); - return (0); } static int |