Module Name: src Committed By: martin Date: Fri Sep 7 12:31:30 UTC 2018
Modified Files: src/sys/net [netbsd-8]: route.c Log Message: Pull up following revision(s) (requested by ozaki-r in ticket #1012): sys/net/route.c: revision 1.212 sys/net/route.c: revision 1.213 route: don't take an extra reference of a rtentry for the delayed free mechanism Because a reference is already taken at that point. - route: avoid overwriting rt_free_global.enqueued unexpectedly rt_free_global.enqueued can be set to true by rt_free during rt_free_work because rt_free_work releases rt_free_global.lock. So rt_free_work must update it once and not update after releasing the lock. To generate a diff of this commit: cvs rdiff -u -r1.194.6.10 -r1.194.6.11 src/sys/net/route.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/net/route.c diff -u src/sys/net/route.c:1.194.6.10 src/sys/net/route.c:1.194.6.11 --- src/sys/net/route.c:1.194.6.10 Fri Jun 8 10:14:33 2018 +++ src/sys/net/route.c Fri Sep 7 12:31:30 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: route.c,v 1.194.6.10 2018/06/08 10:14:33 martin Exp $ */ +/* $NetBSD: route.c,v 1.194.6.11 2018/09/07 12:31:30 martin Exp $ */ /*- * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ #endif #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.194.6.10 2018/06/08 10:14:33 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.194.6.11 2018/09/07 12:31:30 martin Exp $"); #include <sys/param.h> #ifdef RTFLUSH_DEBUG @@ -702,8 +702,8 @@ rt_free_work(struct work *wk, void *arg) struct rtentry *rt; mutex_enter(&rt_free_global.lock); - rt_free_global.enqueued = false; if ((rt = SLIST_FIRST(&rt_free_global.queue)) == NULL) { + rt_free_global.enqueued = false; mutex_exit(&rt_free_global.lock); return; } @@ -726,7 +726,7 @@ rt_free(struct rtentry *rt) } mutex_enter(&rt_free_global.lock); - rt_ref(rt); + /* No need to add a reference here. */ SLIST_INSERT_HEAD(&rt_free_global.queue, rt, rt_free); if (!rt_free_global.enqueued) { workqueue_enqueue(rt_free_global.wq, &rt_free_global.wk, NULL);