From owner-p4-projects@FreeBSD.ORG Wed Oct 29 18:15:51 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D955C16A4D0; Wed, 29 Oct 2003 18:15:50 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B4B0716A4CE for ; Wed, 29 Oct 2003 18:15:50 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3C98243FBD for ; Wed, 29 Oct 2003 18:15:50 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id h9U2FoXJ079655 for ; Wed, 29 Oct 2003 18:15:50 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id h9U2FnTm079652 for perforce@freebsd.org; Wed, 29 Oct 2003 18:15:49 -0800 (PST) (envelope-from sam@freebsd.org) Date: Wed, 29 Oct 2003 18:15:49 -0800 (PST) Message-Id: <200310300215.h9U2FnTm079652@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 40796 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2003 02:15:51 -0000 http://perforce.freebsd.org/chv.cgi?CH=40796 Change 40796 by sam@sam_ebb on 2003/10/29 18:15:18 use a local variable to eliminate holding a lock across a call out of view Affected files ... .. //depot/projects/netperf/sys/netinet6/nd6_nbr.c#6 edit Differences ... ==== //depot/projects/netperf/sys/netinet6/nd6_nbr.c#6 (text+ko) ==== @@ -207,6 +207,7 @@ if (!ifa) { struct rtentry *rt; struct sockaddr_in6 tsin6; + int need_proxy; bzero(&tsin6, sizeof tsin6); tsin6.sin6_len = sizeof(struct sockaddr_in6); @@ -214,8 +215,11 @@ tsin6.sin6_addr = taddr6; rt = rtalloc1((struct sockaddr *)&tsin6, 0, 0); - if (rt && (rt->rt_flags & RTF_ANNOUNCE) != 0 && - rt->rt_gateway->sa_family == AF_LINK) { + need_proxy = (rt && (rt->rt_flags & RTF_ANNOUNCE) != 0 && + rt->rt_gateway->sa_family == AF_LINK); + if (rt) + rtfree(rt); + if (need_proxy) { /* * proxy NDP for single entry */ @@ -226,8 +230,6 @@ proxydl = SDL(rt->rt_gateway); } } - if (rt) - rtfree(rt); } if (!ifa) { /*