summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2003-10-29 22:59:12 +0000
committersam <sam@FreeBSD.org>2003-10-29 22:59:12 +0000
commitf188fceee73166a2c7dc46b964dffa3eb6f8de97 (patch)
treef848248467fb44b7bb8040930f22dafa6d30de4a /sys/netinet6
parente7405e36c19af2fbd59ba156c269a08b15af8f8b (diff)
downloadFreeBSD-src-f188fceee73166a2c7dc46b964dffa3eb6f8de97.zip
FreeBSD-src-f188fceee73166a2c7dc46b964dffa3eb6f8de97.tar.gz
correct LOR by using a local variable to hold result
instead of holding a lock while calling out of view Supported by: FreeBSD Foundation
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/in6.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index 10f7473..ea01b1f 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -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);
}
/*
OpenPOWER on IntegriCloud