summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2006-04-01 15:15:05 +0000
committerrwatson <rwatson@FreeBSD.org>2006-04-01 15:15:05 +0000
commit8622e776f910513e077d822efc579cdb9ba09316 (patch)
tree9714c8659826516cd802bd3b0a45d778b7ebb1a6 /sys/netinet6
parent6b3805592d02e666e50f1d4473fb18c587d69a75 (diff)
downloadFreeBSD-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/netinet6')
-rw-r--r--sys/netinet6/raw_ip6.c7
-rw-r--r--sys/netinet6/udp6_usrreq.c5
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c
index 59bb4a5..8973fdc 100644
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -615,11 +615,11 @@ rip6_detach(struct socket *so)
return 0;
}
-static int
+static void
rip6_abort(struct socket *so)
{
soisdisconnected(so);
- return rip6_detach(so);
+ rip6_detach(so);
}
static int
@@ -630,7 +630,8 @@ rip6_disconnect(struct socket *so)
if ((so->so_state & SS_ISCONNECTED) == 0)
return ENOTCONN;
inp->in6p_faddr = in6addr_any;
- return rip6_abort(so);
+ rip6_abort(so);
+ return 0;
}
static int
diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c
index 8cacd44..f58019e 100644
--- a/sys/netinet6/udp6_usrreq.c
+++ b/sys/netinet6/udp6_usrreq.c
@@ -497,7 +497,7 @@ SYSCTL_PROC(_net_inet6_udp6, OID_AUTO, getcred, CTLTYPE_OPAQUE|CTLFLAG_RW,
0, 0,
udp6_getcred, "S,xucred", "Get the xucred of a UDP6 connection");
-static int
+static void
udp6_abort(struct socket *so)
{
struct inpcb *inp;
@@ -507,7 +507,7 @@ udp6_abort(struct socket *so)
inp = sotoinpcb(so);
if (inp == 0) {
INP_INFO_WUNLOCK(&udbinfo);
- return EINVAL; /* ??? possible? panic instead? */
+ return; /* ??? possible? panic instead? */
}
soisdisconnected(so);
s = splnet();
@@ -515,7 +515,6 @@ udp6_abort(struct socket *so)
in6_pcbdetach(inp);
INP_INFO_WUNLOCK(&udbinfo);
splx(s);
- return 0;
}
static int
OpenPOWER on IntegriCloud