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/netinet/raw_ip.c | |
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/netinet/raw_ip.c')
-rw-r--r-- | sys/netinet/raw_ip.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 33ecb98..b39e693 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -653,7 +653,7 @@ rip_detach(struct socket *so) return 0; } -static int +static void rip_abort(struct socket *so) { struct inpcb *inp; @@ -662,7 +662,7 @@ rip_abort(struct socket *so) inp = sotoinpcb(so); if (inp == 0) { INP_INFO_WUNLOCK(&ripcbinfo); - return EINVAL; /* ??? possible? panic instead? */ + return; /* ??? possible? panic instead? */ } INP_LOCK(inp); soisdisconnected(so); @@ -671,7 +671,6 @@ rip_abort(struct socket *so) else INP_UNLOCK(inp); INP_INFO_WUNLOCK(&ripcbinfo); - return 0; } static int @@ -679,7 +678,8 @@ rip_disconnect(struct socket *so) { if ((so->so_state & SS_ISCONNECTED) == 0) return ENOTCONN; - return rip_abort(so); + rip_abort(so); + return 0; } static int |