diff options
author | bz <bz@FreeBSD.org> | 2009-01-31 10:48:02 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2009-01-31 10:48:02 +0000 |
commit | 226b2a700eecfdf598bf77f229d3a378d11844b4 (patch) | |
tree | db9d96c3d46e2dd5b8ccaa93c6188a5c52063c79 /sys/netinet6/in6.c | |
parent | e2a805f19f85cd20079a30f6532e261f7c2ebe1d (diff) | |
download | FreeBSD-src-226b2a700eecfdf598bf77f229d3a378d11844b4.zip FreeBSD-src-226b2a700eecfdf598bf77f229d3a378d11844b4.tar.gz |
Like with r185713 make sure to not leak a lock as rtalloc1(9) returns
a locked route. Thus we have to use RTFREE_LOCKED(9) to get it unlocked
and rtfree(9)d rather than just rtfree(9)d.
Since the PR was filed, new places with the same problem were added
with new code. Also check that the rt is valid before freeing it
either way there.
PR: kern/129793
Submitted by: Dheeraj Reddy <dheeraj@ece.gatech.edu>
MFC after: 2 weeks
Committed from: Bugathon #6
Diffstat (limited to 'sys/netinet6/in6.c')
-rw-r--r-- | sys/netinet6/in6.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index fc0333b..693a2f9 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -2122,16 +2122,16 @@ in6_lltable_rtcheck(struct ifnet *ifp, const struct sockaddr *l3addr) ifa = ifaof_ifpforaddr(__DECONST(struct sockaddr *, l3addr), ifp); if (ifa != NULL) { if (rt != NULL) - rtfree(rt); + RTFREE_LOCKED(rt); return 0; } log(LOG_INFO, "IPv6 address: \"%s\" is not on the network\n", ip6_sprintf(ip6buf, &((const struct sockaddr_in6 *)l3addr)->sin6_addr)); if (rt != NULL) - rtfree(rt); + RTFREE_LOCKED(rt); return EINVAL; } - rtfree(rt); + RTFREE_LOCKED(rt); return 0; } |