diff options
author | rwatson <rwatson@FreeBSD.org> | 2006-04-01 15:15:05 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2006-04-01 15:15:05 +0000 |
commit | 8622e776f910513e077d822efc579cdb9ba09316 (patch) | |
tree | 9714c8659826516cd802bd3b0a45d778b7ebb1a6 /sys/netipx | |
parent | 6b3805592d02e666e50f1d4473fb18c587d69a75 (diff) | |
download | FreeBSD-src-8622e776f910513e077d822efc579cdb9ba09316.zip FreeBSD-src-8622e776f910513e077d822efc579cdb9ba09316.tar.gz |
Change protocol switch pru_abort() API so that it returns void rather
than an int, as an error here is not meaningful. Modify soabort() to
unconditionally free the socket on the return of pru_abort(), and
modify most protocols to no longer conditionally free the socket,
since the caller will do this.
This commit likely leaves parts of netinet and netinet6 in a situation
where they may panic or leak memory, as they have not are not fully
updated by this commit. This will be corrected shortly in followup
commits to these components.
MFC after: 3 months
Diffstat (limited to 'sys/netipx')
-rw-r--r-- | sys/netipx/ipx_usrreq.c | 8 | ||||
-rw-r--r-- | sys/netipx/spx_usrreq.c | 8 |
2 files changed, 4 insertions, 12 deletions
diff --git a/sys/netipx/ipx_usrreq.c b/sys/netipx/ipx_usrreq.c index 7689d60..b98d5a1 100644 --- a/sys/netipx/ipx_usrreq.c +++ b/sys/netipx/ipx_usrreq.c @@ -75,7 +75,7 @@ static int ipxrecvspace = IPXRCVQ; SYSCTL_INT(_net_ipx_ipx, OID_AUTO, ipxrecvspace, CTLFLAG_RW, &ipxrecvspace, 0, ""); -static int ipx_usr_abort(struct socket *so); +static void ipx_usr_abort(struct socket *so); static int ipx_attach(struct socket *so, int proto, struct thread *td); static int ipx_bind(struct socket *so, struct sockaddr *nam, struct thread *td); static int ipx_connect(struct socket *so, struct sockaddr *nam, @@ -428,7 +428,7 @@ ipx_ctloutput(so, sopt) return (error); } -static int +static void ipx_usr_abort(so) struct socket *so; { @@ -441,10 +441,6 @@ ipx_usr_abort(so) ipx_pcbfree(ipxp); IPX_LIST_UNLOCK(); soisdisconnected(so); - ACCEPT_LOCK(); - SOCK_LOCK(so); - sotryfree(so); - return (0); } static int diff --git a/sys/netipx/spx_usrreq.c b/sys/netipx/spx_usrreq.c index 7db43b3..637ea19 100644 --- a/sys/netipx/spx_usrreq.c +++ b/sys/netipx/spx_usrreq.c @@ -97,7 +97,7 @@ static void spx_template(struct spxpcb *cb); static void spx_timers(struct spxpcb *cb, int timer); static void spx_usrclosed(struct spxpcb *cb); -static int spx_usr_abort(struct socket *so); +static void spx_usr_abort(struct socket *so); static int spx_accept(struct socket *so, struct sockaddr **nam); static int spx_attach(struct socket *so, int proto, struct thread *td); static int spx_bind(struct socket *so, struct sockaddr *nam, struct thread *td); @@ -1305,7 +1305,7 @@ spx_ctloutput(struct socket *so, struct sockopt *sopt) return (error); } -static int +static void spx_usr_abort(struct socket *so) { struct ipxpcb *ipxp; @@ -1324,10 +1324,6 @@ spx_usr_abort(struct socket *so) ipx_pcbdetach(ipxp); ipx_pcbfree(ipxp); IPX_LIST_UNLOCK(); - ACCEPT_LOCK(); - SOCK_LOCK(so); - sotryfree(so); - return (0); } /* |