From owner-freebsd-bugs@FreeBSD.ORG Mon Oct 15 22:30:04 2007 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FAD316A4C9 for ; Mon, 15 Oct 2007 22:30:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id F276913C481 for ; Mon, 15 Oct 2007 22:30:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l9FMU3uw033618 for ; Mon, 15 Oct 2007 22:30:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l9FMU3Wf033613; Mon, 15 Oct 2007 22:30:03 GMT (envelope-from gnats) Date: Mon, 15 Oct 2007 22:30:03 GMT Message-Id: <200710152230.l9FMU3Wf033613@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: John Baldwin Cc: Subject: Re: kern/112490: [route] [patch] Problem in "rt_check" routine. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John Baldwin List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2007 22:30:04 -0000 The following reply was made to PR kern/112490; it has been noted by GNATS. From: John Baldwin To: bug-followup@freebsd.org, mehuljv@yahoo.com Cc: Subject: Re: kern/112490: [route] [patch] Problem in "rt_check" routine. Date: Mon, 15 Oct 2007 16:20:09 -0400 ru@ pointed out a problem in my earlier patch that could result in some double frees. Here is an update: Index: route.c =================================================================== RCS file: /usr/cvs/src/sys/net/route.c,v retrieving revision 1.120 diff -u -r1.120 route.c --- route.c 11 Jun 2007 12:19:34 -0000 1.120 +++ route.c 15 Oct 2007 19:50:53 -0000 @@ -1304,6 +1304,7 @@ if ((rt->rt_flags & RTF_UP) == 0) { RTFREE_LOCKED(rt); /* unlock gwroute */ rt = rt0; + rt->rt_gwroute = NULL; lookup: RT_UNLOCK(rt0); rt = rtalloc1(rt->rt_gateway, 1, 0UL); @@ -1314,6 +1315,8 @@ return (ENETUNREACH); } RT_LOCK(rt0); + if (rt0->rt_gwroute != NULL) + RTFREE(rt0->rt_gwroute); rt0->rt_gwroute = rt; if (rt == NULL) { RT_UNLOCK(rt0); -- John Baldwin