From 2fb6e1296ffa2ee27b6375a79bf615a1e1c62eb3 Mon Sep 17 00:00:00 2001 From: mvs Date: Thu, 27 Apr 2023 14:41:09 +0000 Subject: [PATCH] Remove kernel lock from rtfree(9). Route timers and route labels protected by corresponding mutexes. `ifa' uses references counting for protection. rt_mpls_clear() could be called lockless because this is the last reference of `rt'. ok bluhm@ kn@ --- sys/net/route.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/net/route.c b/sys/net/route.c index 44d661fc949..d9f59e9a4a1 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.420 2023/04/27 11:11:04 mvs Exp $ */ +/* $OpenBSD: route.c,v 1.421 2023/04/27 14:41:09 mvs Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -507,7 +507,6 @@ rtfree(struct rtentry *rt) KASSERT(!RT_ROOT(rt)); atomic_dec_int(&rttrash); - KERNEL_LOCK(); rt_timer_remove_all(rt); ifafree(rt->rt_ifa); rtlabel_unref(rt->rt_labelid); @@ -516,7 +515,6 @@ rtfree(struct rtentry *rt) #endif free(rt->rt_gateway, M_RTABLE, ROUNDUP(rt->rt_gateway->sa_len)); free(rt_key(rt), M_RTABLE, rt_key(rt)->sa_len); - KERNEL_UNLOCK(); pool_put(&rtentry_pool, rt); } -- 2.20.1