From ba713922bfb5e418eb0ecbeff735a08d37bb330a Mon Sep 17 00:00:00 2001 From: Martin Pieuchot Date: Wed, 14 Oct 2015 10:09:31 +0000 Subject: Rewrite the logic around the dymanic array of routing tables to help turning rtable_get(9) MP-safe. Use only one per-AF array, as suggested by claudio@, pointing to an array of pointers to the routing table heads. Routing tables are now allocated/initialized per-AF. This will let us allocate routing table on-demand instead of always having an AF_INET, AF_MPLS and AF_INET table as soon as a new rtableID is used. This also get rid of the "void ***" madness. ok dlg@, jmatthew@ --- sys/net/route.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'sys/net/route.c') diff --git a/sys/net/route.c b/sys/net/route.c index 861a43294c9..fcf62811f6f 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.250 2015/10/13 09:59:37 mpi Exp $ */ +/* $OpenBSD: route.c,v 1.251 2015/10/14 10:09:30 mpi Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -139,7 +139,6 @@ /* Give some jitter to hash, to avoid synchronization between routers. */ static uint32_t rt_hashjitter; -extern void ***rtables; extern unsigned int rtables_id_max; struct rtstat rtstat; @@ -1657,9 +1656,6 @@ rt_if_track(struct ifnet *ifp) int i; u_int tid; - if (rtables == NULL) - return; - for (tid = 0; tid <= rtables_id_max; tid++) { /* skip rtables that are not in the rdomain of the ifp */ if (rtable_l2(tid) != ifp->if_rdomain) -- cgit v1.2.3