On Sun, Dec 22, 2002 at 09:33:29PM +0200, Ruslan Ermilov wrote: > Hi! > > The attached patch fixes the logic of rtrequest1() > when handling RTM_DELETE requests and the caller > asked for a copy of the removed entry. > > Reviewers are highly welcome. > > This makes the code more natural, similar to the > RTM_ADD and RTM_RESOLVE cases (wrt to handling > the returned rtentry's refcnt), and reduces some > code bloat in applications. > > It also makes it safe to turn the RTF_UP bit before > rt_fixdelete() walk -- that was the start of my > looking at this part of code. > Oops, missed one.
Cheers, -- Ruslan Ermilov Sysadmin and DBA, [EMAIL PROTECTED] Sunbay Software AG, [EMAIL PROTECTED] FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age
Index: route.c
===================================================================
RCS file: /home/ncvs/src/sys/net/route.c,v
retrieving revision 1.72
diff -u -p -r1.72 route.c
--- route.c 18 Dec 2002 11:45:27 -0000 1.72
+++ route.c 22 Dec 2002 19:39:54 -0000
@@ -1117,10 +1112,7 @@ rtinit(ifa, cmd, flags)
* If we are deleting, and we found an entry, then
* it's been removed from the tree.. now throw it away.
*/
- if (rt->rt_refcnt <= 0) {
- rt->rt_refcnt++; /* make a 1->0 transition */
- rtfree(rt);
- }
+ RTFREE(rt);
} else if (cmd == RTM_ADD) {
/*
* We just wanted to add it.. we don't actually
msg07914/pgp00000.pgp
Description: PGP signature
