Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 May 2008 06:34:25 GMT
From:      Julian Elischer <julian@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 141631 for review
Message-ID:  <200805150634.m4F6YPCW014875@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)
 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200805150634.m4F6YPCW014875>