From: mvs Date: Thu, 27 Apr 2023 14:41:09 +0000 (+0000) Subject: Remove kernel lock from rtfree(9). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2fb6e1296ffa2ee27b6375a79bf615a1e1c62eb3;p=openbsd 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@ --- 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); }