PERFORCE change 40785 for review

Sam Leffler sam at FreeBSD.org
Wed Oct 29 14:24:32 PST 2003


http://perforce.freebsd.org/chv.cgi?CH=40785

Change 40785 by sam at sam_ebb on 2003/10/29 14:23:30

	correct LOR by using a local variable to hold result
	instead of holding a lock while calling out of view

Affected files ...

.. //depot/projects/netperf/sys/netinet6/in6.c#11 edit

Differences ...

==== //depot/projects/netperf/sys/netinet6/in6.c#11 (text+ko) ====

@@ -214,14 +214,16 @@
 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);
 }
 
 /*


More information about the p4-projects mailing list