1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

correct LOR by using a local variable to hold result

instead of holding a lock while calling out of view

Supported by:	FreeBSD Foundation
This commit is contained in:
Sam Leffler 2003-10-29 22:59:12 +00:00
parent ec49974ac2
commit 2657cae39a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=121716

View File

@ -214,14 +214,16 @@ static void
in6_ifaddloop(struct ifaddr *ifa)
{
struct rtentry *rt;
int need_loop;
/* If there is no loopback entry, allocate one. */
rt = rtalloc1(ifa->ifa_addr, 0, 0);
if (rt == NULL || (rt->rt_flags & RTF_HOST) == 0 ||
(rt->rt_ifp->if_flags & IFF_LOOPBACK) == 0)
in6_ifloop_request(RTM_ADD, ifa);
need_loop = (rt == NULL || (rt->rt_flags & RTF_HOST) == 0 ||
(rt->rt_ifp->if_flags & IFF_LOOPBACK) == 0);
if (rt)
rtfree(rt);
if (need_loop)
in6_ifloop_request(RTM_ADD, ifa);
}
/*