Route timers and route labels protected by corresponding mutexes. `ifa'
uses references counting for protection. No protection required for `rt'
passed to rt_mpls_clear() because only current thread owns it.

ok?

Index: sys/net/route.c
===================================================================
RCS file: /cvs/src/sys/net/route.c,v
retrieving revision 1.418
diff -u -p -r1.418 route.c
--- sys/net/route.c     26 Apr 2023 16:09:44 -0000      1.418
+++ sys/net/route.c     26 Apr 2023 20:11:16 -0000
@@ -497,7 +497,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);
@@ -506,7 +505,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);
 }

Reply via email to