From owner-p4-projects@FreeBSD.ORG Thu May 15 06:34:26 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E3BAE1065682; Thu, 15 May 2008 06:34:25 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5ACF106567C for ; Thu, 15 May 2008 06:34:25 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 95FB98FC29 for ; Thu, 15 May 2008 06:34:25 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m4F6YP6D014877 for ; Thu, 15 May 2008 06:34:25 GMT (envelope-from julian@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m4F6YPCW014875 for perforce@freebsd.org; Thu, 15 May 2008 06:34:25 GMT (envelope-from julian@freebsd.org) Date: Thu, 15 May 2008 06:34:25 GMT Message-Id: <200805150634.m4F6YPCW014875@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to julian@freebsd.org using -f From: Julian Elischer To: Perforce Change Reviews Cc: Subject: PERFORCE change 141631 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2008 06:34:26 -0000 http://perforce.freebsd.org/chv.cgi?CH=141631 Change 141631 by julian@julian_trafmon1 on 2008/05/15 06:34:23 work towards compiling Affected files ... .. //depot/projects/vimage/src/sys/net/route.c#16 edit Differences ... ==== //depot/projects/vimage/src/sys/net/route.c#16 (text+ko) ==== @@ -126,6 +126,8 @@ */ #define RNTORT(p) ((struct rtentry *)(p)) +static uma_zone_t rtzone; /* Routing table UMA zone. */ + #if 0 /* default fib for tunnels to use */ u_int tunnel_fib = 0; @@ -146,32 +148,73 @@ return (error); } +SYSCTL_PROC(_net, OID_AUTO, my_fibnum, CTLTYPE_INT|CTLFLAG_RD, + NULL, 0, &sysctl_my_fibnum, "I", "default FIB of caller"); + #ifdef VIMAGE static int -rtable_idetach(unused) - const void *unused; +rtable_init(const void *unused) { - INIT_VNET_NET(curvnet); + int table; + int fam; + struct domain *dom; + INIT_VNET_NET(curvnet); - struct domain *dom; - for (dom = domains; dom; dom = dom->dom_next) - if (dom->dom_rtdetach) - dom->dom_rtdetach((void *)&V_rt_tables[dom->dom_family], - dom->dom_rtoffset); - return 0; + for (dom = domains; dom; dom = dom->dom_next) { + if (dom->dom_rtattach) { + for (table = 0; table < rt_numfibs; table++) { + if ( (fam = dom->dom_family) == AF_INET || + table == 0) { + /* for now only AF_INET has > 1 table */ + /* XXX MRT + * rtattach will be also called + * from vfs_export.c but the + * offset will be 0 + * (only for AF_INET and AF_INET6 + * which don't need it anyhow) + */ + dom->dom_rtattach( + (void **)&V_rt_tables[table][fam], + dom->dom_rtoffset); + } else { + break; + } + } + } + } + return 0; } -#endif - -SYSCTL_PROC(_net, OID_AUTO, my_fibnum, CTLTYPE_INT|CTLFLAG_RD, - NULL, 0, &sysctl_my_fibnum, "I", "default FIB of caller"); - -VNET_MOD_DECLARE_STATELESS(RTABLE, rtable, rtable_init, rtable_idetach, NET) static int -rtable_init(const void *unused) +rtable_idetach(const void *unused); { + int table; + int fam; + struct domain *dom; + INIT_VNET_NET(curvnet); + + struct domain *dom; + for (dom = domains; dom; dom = dom->dom_next) { + if (dom->dom_rtdetach) { + for (table = 0; table < rt_numfibs; table++) { + if ( (fam = dom->dom_family) == AF_INET || + table == 0) { + /* for now only AF_INET has > 1 table */ + dom->dom_rtdetach( + (void **)&V_rt_tables[table][fam], + dom->dom_rtoffset); + } else { + break; + } + } + } + } + return 0; } +VNET_MOD_DECLARE_STATELESS(RTABLE, rtable, rtable_init, rtable_idetach, NET); +#endif + static void route_init(void) {