Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Oct 2007 22:30:03 GMT
From:      John Baldwin <john@baldwin.cx>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/112490: [route] [patch] Problem in "rt_check" routine.
Message-ID:  <200710152230.l9FMU3Wf033613@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/112490; it has been noted by GNATS.

From: John Baldwin <john@baldwin.cx>
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200710152230.l9FMU3Wf033613>