PERFORCE change 143054 for review

Julian Elischer julian at FreeBSD.org
Fri Jun 6 21:04:12 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=143054

Change 143054 by julian at julian_trafmon1 on 2008/06/06 21:03:57

	Phew!

Affected files ...

.. //depot/projects/vimage-commit/V_#2 edit

Differences ...

==== //depot/projects/vimage-commit/V_#2 (text+ko) ====

@@ -12667,14 +12667,6 @@
  
  #include <net/if.h>
  #include <net/route.h>
-@@ -52,6 +55,7 @@
- #include <netinet/in.h>
- #include <netinet/in_var.h>
- #include <netinet/ip6.h>
-+#include <netinet6/vinet6.h>
- #include <netinet6/ip6_var.h>
- #include <netinet/icmp6.h>
- 
 @@ -61,6 +65,7 @@
  int
  dest6_input(struct mbuf **mp, int *offp, int proto)
@@ -12714,27 +12706,7 @@
  
  #include <net/if.h>
  #include <net/route.h>
-@@ -50,6 +54,7 @@
- #include <netinet/in.h>
- #include <netinet/in_var.h>
- #include <netinet/ip6.h>
-+#include <netinet6/vinet6.h>
- #include <netinet6/ip6_var.h>
- #include <netinet/icmp6.h>
- #include <netinet/in_systm.h>	/* for ECN definitions */
-@@ -72,9 +77,11 @@
- /*
-  * These fields all protected by ip6qlock.
-  */
-+#ifndef VIMAGE
- static u_int frag6_nfragpackets;
- static u_int frag6_nfrags;
- static struct	ip6q ip6q;	/* ip6 reassemble queue */
-+#endif
- 
- #define	IP6Q_LOCK_INIT()	mtx_init(&ip6qlock, "ip6qlock", NULL, MTX_DEF);
- #define	IP6Q_LOCK()		mtx_lock(&ip6qlock)
-@@ -90,23 +97,28 @@
+@@ -90,23 +97,25 @@
  static void
  frag6_change(void *tag)
  {
@@ -12753,19 +12725,14 @@
  
 -	ip6_maxfragpackets = nmbclusters / 4;
 -	ip6_maxfrags = nmbclusters / 4;
-+	V_ip6q.ip6q_next = V_ip6q.ip6q_prev = &V_ip6q;
 +	V_ip6_maxfragpackets = nmbclusters / 4;
 +	V_ip6_maxfrags = nmbclusters / 4;
-+#ifdef VIMAGE
-+	if (!IS_DEFAULT_VNET(curvnet))
-+		return;
-+#endif
  	EVENTHANDLER_REGISTER(nmbclusters_change,
  	    frag6_change, NULL, EVENTHANDLER_PRI_ANY);
  
  	IP6Q_LOCK_INIT();
--
--	ip6q.ip6q_next = ip6q.ip6q_prev = &ip6q;
+ 
+ 	ip6q.ip6q_next = ip6q.ip6q_prev = &ip6q;
  }
  
  /*
@@ -12910,12 +12877,11 @@
  }
  
  /*
-@@ -688,13 +702,15 @@
+@@ -688,13 +702,14 @@
  #endif
  
  	IP6Q_LOCK();
 -	q6 = ip6q.ip6q_next;
-+	VNET_ITERLOOP_BEGIN()
 +	INIT_VNET_INET6(curvnet);
 +	q6 = V_ip6q.ip6q_next;
  	if (q6)
@@ -12929,7 +12895,7 @@
  				/* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */
  				frag6_freef(q6->ip6q_prev);
  			}
-@@ -704,12 +720,13 @@
+@@ -704,12 +720,12 @@
  	 * (due to the limit being lowered), drain off
  	 * enough to get down to the new limit.
  	 */
@@ -12943,7 +12909,6 @@
 -		frag6_freef(ip6q.ip6q_prev);
 +		frag6_freef(V_ip6q.ip6q_prev);
  	}
-+	VNET_ITERLOOP_END()
  	IP6Q_UNLOCK();
  
  #if 0
@@ -12960,13 +12925,12 @@
  	}
  	if (ipsrcchk_rt.ro_rt) {
  		RTFREE(ipsrcchk_rt.ro_rt);
-@@ -738,10 +755,13 @@
+@@ -738,10 +755,11 @@
  
  	if (IP6Q_TRYLOCK() == 0)
  		return;
 -	while (ip6q.ip6q_next != &ip6q) {
 -		ip6stat.ip6s_fragdropped++;
-+	VNET_ITERLOOP_BEGIN()
 +	INIT_VNET_INET6(curvnet);
 +	while (V_ip6q.ip6q_next != &V_ip6q) {
 +		V_ip6stat.ip6s_fragdropped++;
@@ -12974,7 +12938,6 @@
 -		frag6_freef(ip6q.ip6q_next);
 +		frag6_freef(V_ip6q.ip6q_next);
  	}
-+	VNET_ITERLOOP_END()
  	IP6Q_UNLOCK();
  }
 Index: sys/netinet6/icmp6.c
@@ -12989,45 +12952,26 @@
  
  #include <sys/param.h>
  #include <sys/domain.h>
-@@ -81,18 +82,22 @@
+@@ -81,18 +82,19 @@
  #include <sys/syslog.h>
  #include <sys/systm.h>
  #include <sys/time.h>
 +#include <sys/vimage.h>
  
-+#include <net/vnet.h>
  #include <net/if.h>
  #include <net/if_dl.h>
  #include <net/if_types.h>
  #include <net/route.h>
  
-+#include <netinet/vinet.h>
  #include <netinet/in.h>
  #include <netinet/in_pcb.h>
  #include <netinet/in_var.h>
  #include <netinet/ip6.h>
  #include <netinet/icmp6.h>
  #include <netinet/tcp_var.h>
-+#include <netinet6/vinet6.h>
  #include <netinet6/in6_ifattach.h>
  #include <netinet6/in6_pcb.h>
  #include <netinet6/ip6protosw.h>
-@@ -112,10 +117,14 @@
- 
- extern struct inpcbinfo ripcbinfo;
- extern struct inpcbhead ripcb;
-+#ifndef VIMAGE
- extern int icmp6errppslim;
--static int icmp6errpps_count = 0;
-+static int icmp6errpps_count;
-+#endif /* !VIMAGE */
- static struct timeval icmp6errppslim_last;
-+#ifndef VIMAGE
- extern int icmp6_nodeinfo;
-+#endif /* !VIMAGE */
- 
- static void icmp6_errcount(struct icmp6errstat *, int, int);
- static int icmp6_rip6_input(struct mbuf **, int);
 @@ -135,6 +144,8 @@
  void
  icmp6_init(void)
@@ -13111,7 +13055,7 @@
  icmp6_input(struct mbuf **mp, int *offp, int proto)
  {
 +	INIT_VNET_INET6(curvnet);
-+	/* XXX this bellow is WRONG - MARKO */
++	/* XXX this below is WRONG - MARKO */
 +	INIT_VPROCG(TD_TO_VPROCG(curthread));
  	struct mbuf *m = *mp, *n;
  	struct ip6_hdr *ip6, *nip6;
@@ -13580,14 +13524,6 @@
  #include <net/if.h>
  #include <net/if_types.h>
  #include <net/route.h>
-@@ -92,6 +95,7 @@
- #include <netinet/in_pcb.h>
- 
- #include <netinet/ip6.h>
-+#include <netinet6/vinet6.h>
- #include <netinet6/ip6_var.h>
- #include <netinet6/nd6.h>
- #include <netinet6/mld6_var.h>
 @@ -230,6 +234,7 @@
  void
  in6_ifremloop(struct ifaddr *ifa)
@@ -13782,36 +13718,6 @@
  
  #include <net/if.h>
  #include <net/route.h>
-@@ -57,6 +58,7 @@
- #endif
- #include <netinet/ip_encap.h>
- #ifdef INET6
-+#include <netinet6/vinet6.h>
- #include <netinet/ip6.h>
- #include <netinet6/ip6_var.h>
- #include <netinet6/in6_gif.h>
-@@ -74,12 +76,15 @@
- 			 struct ifnet *);
- 
- extern  struct domain inet6domain;
--struct ip6protosw in6_gif_protosw =
--{ SOCK_RAW,	&inet6domain,	0/* IPPROTO_IPV[46] */,	PR_ATOMIC|PR_ADDR,
--  in6_gif_input, rip6_output,	0,		rip6_ctloutput,
--  0,
--  0,		0,		0,		0,
--  &rip6_usrreqs
-+struct ip6protosw in6_gif_protosw = {
-+	.pr_type =		SOCK_RAW,
-+	.pr_domain =		&inet6domain,
-+	.pr_protocol = 		0/* IPPROTO_IPV[46] */,
-+	.pr_flags = 		PR_ATOMIC|PR_ADDR,
-+	.pr_input = 		in6_gif_input,
-+	.pr_output = 		rip6_output,
-+	.pr_ctloutput = 	rip6_ctloutput,
-+	.pr_usrreqs = 		&rip6_usrreqs
- };
- 
- int
 @@ -87,6 +92,7 @@
      int family,			/* family of the packet to be encapsulate */
      struct mbuf *m)
@@ -13876,26 +13782,23 @@
  #include <sys/param.h>
  #include <sys/systm.h>
  #include <sys/malloc.h>
-@@ -40,18 +42,22 @@
+@@ -40,18 +42,19 @@
  #include <sys/kernel.h>
  #include <sys/syslog.h>
  #include <sys/md5.h>
 +#include <sys/vimage.h>
  
-+#include <net/vnet.h>
  #include <net/if.h>
  #include <net/if_dl.h>
  #include <net/if_types.h>
  #include <net/route.h>
  
-+#include <netinet/vinet.h>
  #include <netinet/in.h>
  #include <netinet/in_var.h>
  #include <netinet/if_ether.h>
  #include <netinet/in_pcb.h>
  
  #include <netinet/ip6.h>
-+#include <netinet6/vinet6.h>
  #include <netinet6/ip6_var.h>
  #include <netinet6/in6_var.h>
  #include <netinet6/in6_pcb.h>
@@ -13903,23 +13806,18 @@
  #include <netinet6/nd6.h>
  #include <netinet6/scope6_var.h>
  
--unsigned long in6_maxmtu = 0;
--
--#ifdef IP6_AUTO_LINKLOCAL
--int ip6_auto_linklocal = IP6_AUTO_LINKLOCAL;
--#else
--int ip6_auto_linklocal = 1;	/* enable by default */
--#endif
--
-+#ifndef VIMAGE
-+unsigned long in6_maxmtu;
-+int ip6_auto_linklocal;
+ unsigned long in6_maxmtu = 0;
+ 
+ #ifdef IP6_AUTO_LINKLOCAL
+ int ip6_auto_linklocal = IP6_AUTO_LINKLOCAL;
+ #else
+ int ip6_auto_linklocal = 1;	/* enable by default */
+ #endif
+ 
  struct callout in6_tmpaddrtimer_ch;
--
-+extern struct inpcbinfo ripcbinfo;
+ 
  extern struct inpcbinfo udbinfo;
--extern struct inpcbinfo ripcbinfo;
-+#endif
+ extern struct inpcbinfo ripcbinfo;
  
  static int get_rand_ifid(struct ifnet *, struct in6_addr *);
  static int generate_tmp_ifid(u_int8_t *, const u_int8_t *, u_int8_t *);
@@ -14115,7 +14013,7 @@
  
  #include <sys/param.h>
  #include <sys/systm.h>
-@@ -82,19 +83,24 @@
+@@ -82,19 +83,21 @@
  #include <sys/priv.h>
  #include <sys/proc.h>
  #include <sys/jail.h>
@@ -14123,12 +14021,10 @@
  
  #include <vm/uma.h>
  
-+#include <net/vnet.h>
  #include <net/if.h>
  #include <net/if_types.h>
  #include <net/route.h>
  
-+#include <netinet/vinet.h>
  #include <netinet/in.h>
  #include <netinet/in_var.h>
  #include <netinet/in_systm.h>
@@ -14136,7 +14032,6 @@
  #include <netinet/ip6.h>
  #include <netinet/ip_var.h>
 +
-+#include <netinet6/vinet6.h>
  #include <netinet6/ip6_var.h>
  #include <netinet6/nd6.h>
  #include <netinet/in_pcb.h>
@@ -14222,169 +14117,13 @@
  
  #include <net/if.h>
  #include <net/radix.h>
-@@ -87,6 +89,7 @@
- #ifdef RADIX_MPATH
- #include <net/radix_mpath.h>
- #endif
-+#include <net/if_gif.h>
+@@ -454,124 +450,142 @@
  
- #include <netinet/in.h>
- #include <netinet/in_systm.h>
-@@ -95,6 +98,7 @@
- #include <netinet/ip.h>
- #include <netinet/ip_var.h>
- #include <netinet/ip6.h>
-+#include <netinet6/vinet6.h>
- #include <netinet6/ip6_var.h>
- #include <netinet/icmp6.h>
- 
-@@ -144,6 +148,9 @@
- 	.pr_domain =		&inet6domain,
- 	.pr_protocol =		IPPROTO_IPV6,
- 	.pr_init =		ip6_init,
-+#ifdef VIMAGE
-+	.pr_destroy =		ip6_destroy,
-+#endif
- 	.pr_slowtimo =		frag6_slowtimo,
- 	.pr_drain =		frag6_drain,
- 	.pr_usrreqs =		&nousrreqs,
-@@ -344,26 +351,10 @@
- };
- 
- extern int in6_inithead(void **, int);
--
--struct domain inet6domain = {
--	.dom_family =		AF_INET6,
--	.dom_name =		"internet6",
--	.dom_protosw =		(struct protosw *)inet6sw,
--	.dom_protoswNPROTOSW =	(struct protosw *)
--				&inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])],
--#ifdef RADIX_MPATH
--	.dom_rtattach =		rn6_mpath_inithead,
--#else
--	.dom_rtattach =		in6_inithead,
-+#ifdef VIMAGE
-+extern int in6_detachhead(void **, int);
- #endif
--	.dom_rtoffset =		offsetof(struct sockaddr_in6, sin6_addr) << 3,
--	.dom_maxrtkey =		sizeof(struct sockaddr_in6),
--	.dom_ifattach =		in6_domifattach,
--	.dom_ifdetach =		in6_domifdetach
--};
- 
--DOMAIN_SET(inet6);
--
- /*
-  * Internet configuration info
-  */
-@@ -379,29 +370,31 @@
- #define	IPV6_SENDREDIRECTS	1
- #endif
- 
--int	ip6_forwarding = IPV6FORWARDING;	/* act as router? */
--int	ip6_sendredirects = IPV6_SENDREDIRECTS;
--int	ip6_defhlim = IPV6_DEFHLIM;
--int	ip6_defmcasthlim = IPV6_DEFAULT_MULTICAST_HOPS;
--int	ip6_accept_rtadv = 0;	/* "IPV6FORWARDING ? 0 : 1" is dangerous */
-+#ifndef VIMAGE
-+int	ip6_forwarding;		/* act as router? */
-+int	ip6_sendredirects;
-+int	ip6_defhlim;
-+int	ip6_defmcasthlim;
-+int	ip6_accept_rtadv;	/* "IPV6FORWARDING ? 0 : 1" is dangerous */
- int	ip6_maxfragpackets;	/* initialized in frag6.c:frag6_init() */
--int	ip6_maxfrags;	/* initialized in frag6.c:frag6_init() */
--int	ip6_log_interval = 5;
--int	ip6_hdrnestlimit = 15;	/* How many header options will we process? */
--int	ip6_dad_count = 1;	/* DupAddrDetectionTransmits */
--int	ip6_auto_flowlabel = 1;
--int	ip6_gif_hlim = 0;
--int	ip6_use_deprecated = 1;	/* allow deprecated addr (RFC2462 5.5.4) */
--int	ip6_rr_prune = 5;	/* router renumbering prefix
-+int	ip6_maxfrags;		/* initialized in frag6.c:frag6_init() */
-+int	ip6_log_interval;
-+int	ip6_hdrnestlimit;	/* How many header options will we process? */
-+int	ip6_dad_count;		/* DupAddrDetectionTransmits */
-+int	ip6_auto_flowlabel;
-+int     ip6_gif_hlim = 0;
-+int	ip6_use_deprecated;	/* allow deprecated addr (RFC2462 5.5.4) */
-+int	ip6_rr_prune;		/* router renumbering prefix
- 				 * walk list every 5 sec. */
--int	ip6_mcast_pmtu = 0;	/* enable pMTU discovery for multicast? */
--int	ip6_v6only = 1;
-+int	ip6_mcast_pmtu;		/* enable pMTU discovery for multicast? */
-+int	ip6_v6only;
- 
--int	ip6_keepfaith = 0;
--time_t	ip6_log_time = (time_t)0L;
-+int	ip6_keepfaith;
-+time_t	ip6_log_time;
- #ifdef IPSTEALTH
--int	ip6stealth = 0;
-+int	ip6stealth;
- #endif
-+#endif /* !VIMAGE */
- 
- /* icmp6 */
- /*
-@@ -409,8 +402,10 @@
-  * XXX: what if we don't define INET? Should we define pmtu6_expire
-  * or so? (jinmei at kame.net 19990310)
-  */
--int pmtu_expire = 60*10;
--int pmtu_probe = 60*2;
-+#ifndef VIMAGE
-+int pmtu_expire;
-+int pmtu_probe;
-+#endif
- 
- /* raw IP6 parameters */
- /*
-@@ -419,20 +414,21 @@
- #define	RIPV6SNDQ	8192
- #define	RIPV6RCVQ	8192
- 
--u_long	rip6_sendspace = RIPV6SNDQ;
--u_long	rip6_recvspace = RIPV6RCVQ;
-+#ifndef VIMAGE
-+u_long	rip6_sendspace;
-+u_long	rip6_recvspace;
- 
- /* ICMPV6 parameters */
--int	icmp6_rediraccept = 1;		/* accept and process redirects */
--int	icmp6_redirtimeout = 10 * 60;	/* 10 minutes */
--int	icmp6errppslim = 100;		/* 100pps */
-+int	icmp6_rediraccept;	/* accept and process redirects */
-+int	icmp6_redirtimeout;
-+int	icmp6errppslim;	
- /* control how to respond to NI queries */
--int	icmp6_nodeinfo = (ICMP6_NODEINFO_FQDNOK|ICMP6_NODEINFO_NODEADDROK);
-+int	icmp6_nodeinfo;
- 
- /* UDP on IP6 parameters */
--int	udp6_sendspace = 9216;		/* really max datagram size */
--int	udp6_recvspace = 40 * (1024 + sizeof(struct sockaddr_in6));
--					/* 40 1K datagrams */
-+int	udp6_sendspace;		/* really max datagram size */
-+int	udp6_recvspace;
-+#endif /* !VIMAGE */
- 
- /*
-  * sysctl related items.
-@@ -454,124 +450,201 @@
- 
  /* net.inet6.ip6 */
  static int
-+#ifdef VIMAGE
-+sysctl_ip6_temppltime(SYSCTL_HANDLER_V_ARGS)
-+#else
  sysctl_ip6_temppltime(SYSCTL_HANDLER_ARGS)
-+#endif
  {
 +	INIT_VNET_INET6(curvnet);
-+#ifdef VIMAGE
-+	SYSCTL_RESOLVE_V_ARG1();
-+#endif
  	int error = 0;
  	int old;
  
@@ -14406,16 +14145,9 @@
  }
  
  static int
-+#ifdef VIMAGE
-+sysctl_ip6_tempvltime(SYSCTL_HANDLER_V_ARGS)
-+#else
  sysctl_ip6_tempvltime(SYSCTL_HANDLER_ARGS)
-+#endif
  {
 +	INIT_VNET_INET6(curvnet);
-+#ifdef VIMAGE
-+	SYSCTL_RESOLVE_V_ARG1();
-+#endif
  	int error = 0;
  	int old;
  
@@ -14598,48 +14330,6 @@
 +SYSCTL_V_INT(V_NET, vnet_inet6, _net_inet6_icmp6, ICMPV6CTL_ND6_DEBUG,
 +	nd6_debug, CTLFLAG_RW,	nd6_debug,		0, "");
 +
-+static void
-+ip6_dom_init(void)
-+{
-+	INIT_VNET_INET6(curvnet);
-+
-+	V_ip6_forwarding = IPV6FORWARDING;
-+	V_ip6_sendredirects = IPV6_SENDREDIRECTS;
-+	V_ip6_defhlim = IPV6_DEFHLIM;
-+	V_ip6_defmcasthlim = IPV6_DEFAULT_MULTICAST_HOPS;
-+	V_ip6_accept_rtadv = 0;
-+	V_ip6_log_interval = 5;
-+	V_ip6_hdrnestlimit = 15;
-+	V_ip6_dad_count = 1;
-+	V_ip6_auto_flowlabel = 1;
-+	V_ip6_use_deprecated = 1;
-+	V_ip6_rr_prune = 5;
-+	V_ip6_mcast_pmtu = 0;
-+	V_ip6_v6only = 1;
-+	V_ip6_keepfaith = 0;
-+	V_ip6_log_time = (time_t)0L;
-+#ifdef IPSTEALTH
-+	V_ip6stealth = 0;
-+#endif
-+	V_pmtu_expire = 60*10;
-+	V_pmtu_probe = 60*2;
-+	V_rip6_sendspace = RIPV6SNDQ;
-+	V_rip6_recvspace = RIPV6RCVQ;
-+
-+	/* ICMPV6 parameters */
-+	V_icmp6_rediraccept = 1;
-+	V_icmp6_redirtimeout = 10 * 60;	/* 10 minutes */
-+	V_icmp6errppslim = 100;		/* 100pps */
-+	/* control how to respond to NI queries */
-+	V_icmp6_nodeinfo = (ICMP6_NODEINFO_FQDNOK|ICMP6_NODEINFO_NODEADDROK);
-+
-+	/* UDP on IP6 parameters */
-+	V_udp6_sendspace = 9216;	/* really max datagram size */
-+	V_udp6_recvspace = 40 * (1024 + sizeof(struct sockaddr_in6));
-+					/* 40 1K datagrams */
-+
-+}
-+
 +struct domain inet6domain = {
 +	.dom_family =		AF_INET6,
 +	.dom_name =		"internet6",
@@ -14647,9 +14337,6 @@
 +	.dom_protoswNPROTOSW =	(struct protosw *)
 +				&inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])],
 +	.dom_rtattach =		in6_inithead,
-+#ifdef VIMAGE
-+	.dom_rtdetach =		in6_detachhead,
-+#endif
 +	.dom_rtoffset =		offsetof(struct sockaddr_in6, sin6_addr) << 3,
 +	.dom_maxrtkey =		sizeof(struct sockaddr_in6),
 +	.dom_ifattach =		in6_domifattach,
@@ -14671,44 +14358,27 @@
  #include <sys/param.h>
  #include <sys/systm.h>
  #include <sys/kernel.h>
-@@ -85,13 +87,17 @@
+@@ -85,13 +87,14 @@
  #include <sys/mbuf.h>
  #include <sys/syslog.h>
  #include <sys/callout.h>
 +#include <sys/vimage.h>
  
-+#include <net/vnet.h>
  #include <net/if.h>
  #include <net/route.h>
  #include <netinet/in.h>
  #include <netinet/ip_var.h>
  #include <netinet/in_var.h>
  
-+#include <netinet6/vinet6.h>
-+
  #include <netinet/ip6.h>
  #include <netinet6/ip6_var.h>
  
-@@ -104,6 +110,9 @@
- #include <netinet/tcp_var.h>
- 
- extern int	in6_inithead(void **head, int off);
-+#ifdef VIMAGE
-+extern int	in6_detachhead(void **head, int off);
-+#endif
- 
- #define RTPRF_OURS		RTF_PROTO3	/* set on routes we manage */
- 
-@@ -321,20 +330,25 @@
+@@ -321,20 +330,23 @@
  }
  
  #define RTQ_TIMEOUT	60*10	/* run no less than once every ten minutes */
--static int rtq_timeout = RTQ_TIMEOUT;
--static struct callout rtq_timer;
-+#ifndef VIMAGE
-+static int rtq_timeout6;
-+static struct callout rtq_timer6;
-+#endif
+ static int rtq_timeout = RTQ_TIMEOUT;
+ static struct callout rtq_timer;
  
  static void
  in6_rtqtimo(void *rock)
@@ -14748,16 +14418,6 @@
  }
  
  /*
-@@ -380,7 +395,9 @@
- 	struct radix_node_head *rnh;
- 	time_t nextstop;
- };
-+#ifndef VIMAGE
- static struct callout rtq_mtutimer;
-+#endif
- 
- static int
- in6_mtuexpire(struct radix_node *rn, void *rock)
 @@ -409,7 +426,10 @@
  static void
  in6_mtutimo(void *rock)
@@ -14797,7 +14457,7 @@
  	struct radix_node_head *rnh;
  
  	if (!rn_inithead(head, offsetof(struct sockaddr_in6, sin6_addr) << 3))
-@@ -465,13 +488,26 @@
+@@ -465,13 +488,14 @@
  	if (off == 0)		/* See above */
  		return 1;	/* only do the rest for the real thing */
  
@@ -14811,23 +14471,11 @@
 -	callout_init(&rtq_mtutimer, CALLOUT_MPSAFE);
 -	in6_mtutimo(rnh);	/* kick off timeout first time */
 +	callout_init(&V_rtq_timer6, CALLOUT_MPSAFE);
++	in6_rtqtimo(rnh);	/* kick off timeout first time */
 +	callout_init(&V_rtq_mtutimer, CALLOUT_MPSAFE);
-+	in6_rtqtimo(curvnet);	/* kick off timeout first time */
-+	in6_mtutimo(curvnet);	/* kick off timeout first time */
-+	return 1;
-+}
-+
-+#ifdef VIMAGE
-+int
-+in6_detachhead(void **head, int off)
-+{
-+	INIT_VNET_INET6(curvnet);
-+
-+	callout_drain(&V_rtq_timer6);
-+	callout_drain(&V_rtq_mtutimer);
++	in6_mtutimo(rnh);	/* kick off timeout first time */
  	return 1;
  }
-+#endif
 Index: sys/netinet6/in6_src.c
 ===========================================================================
 --- sys/netinet6/in6_src.c	2008/06/02 18:20:02	#48
@@ -14840,42 +14488,27 @@
  
  #include <sys/param.h>
  #include <sys/systm.h>
-@@ -82,18 +83,23 @@
+@@ -82,18 +83,20 @@
  #include <sys/time.h>
  #include <sys/kernel.h>
  #include <sys/sx.h>
 +#include <sys/vimage.h>
  
-+#include <net/vnet.h>
  #include <net/if.h>
  #include <net/route.h>
  #ifdef RADIX_MPATH
  #include <net/radix_mpath.h>
  #endif
  
-+#include <netinet/vinet.h>
  #include <netinet/in.h>
  #include <netinet/in_var.h>
  #include <netinet/in_systm.h>
  #include <netinet/ip.h>
  #include <netinet/in_pcb.h>
 +
-+#include <netinet6/vinet6.h>
  #include <netinet6/in6_var.h>
  #include <netinet/ip6.h>
  #include <netinet6/in6_pcb.h>
-@@ -115,9 +121,11 @@
- #define	ADDRSEL_XUNLOCK()	sx_xunlock(&addrsel_sxlock)
- 
- #define ADDR_LABEL_NOTAPP (-1)
-+#ifndef VIMAGE
- struct in6_addrpolicy defaultaddrpolicy;
- 
- int ip6_prefer_tempaddr = 0;
-+#endif
- 
- static int selectroute __P((struct sockaddr_in6 *, struct ip6_pktopts *,
- 	struct ip6_moptions *, struct route_in6 *, struct ifnet **,
 @@ -142,9 +150,9 @@
   * an entry to the caller for later use.
   */
@@ -15022,12 +14655,12 @@
  		lastport = &pcbinfo->ipi_lastport;
  	}
  	/*
-@@ -851,26 +864,34 @@
+@@ -851,26 +864,28 @@
  void
  addrsel_policy_init(void)
  {
--	ADDRSEL_LOCK_INIT();
--	ADDRSEL_SXLOCK_INIT();
+ 	ADDRSEL_LOCK_INIT();
+ 	ADDRSEL_SXLOCK_INIT();
 +	INIT_VNET_INET6(curvnet);
  
  	init_policy_queue();
@@ -15037,14 +14670,6 @@
 -	defaultaddrpolicy.label = ADDR_LABEL_NOTAPP;
 +	bzero(&V_defaultaddrpolicy, sizeof(V_defaultaddrpolicy));
 +	V_defaultaddrpolicy.label = ADDR_LABEL_NOTAPP;
-+
-+#ifdef VIMAGE
-+	if (!IS_DEFAULT_VNET(curvnet))
-+		return;
-+#endif
-+
-+	ADDRSEL_LOCK_INIT();
-+	ADDRSEL_SXLOCK_INIT();
  }
  
  static struct in6_addrpolicy *
@@ -15066,13 +14691,10 @@
  	struct in6_addrpolicy ape_policy;
  };
  
--TAILQ_HEAD(addrsel_policyhead, addrsel_policyent);
-+#ifndef VIMAGE
-+TAILQ_HEAD(, addrsel_policyent) addrsel_policytab;
-+#endif
+ TAILQ_HEAD(addrsel_policyhead, addrsel_policyent);
+ 
+ struct addrsel_policyhead addrsel_policytab;
  
--struct addrsel_policyhead addrsel_policytab;
--
  static void
  init_policy_queue(void)
  {
@@ -15161,22 +14783,6 @@
  		matchlen = 0;
  
  		pol = &pent->ape_policy;
-Index: sys/netinet6/in6_var.h
-===========================================================================
---- sys/netinet6/in6_var.h	2008/06/02 18:20:02	#25
-+++ sys/netinet6/in6_var.h	2008/06/02 18:20:02
-@@ -470,9 +470,11 @@
- #endif
- 
- #ifdef _KERNEL
-+#ifndef VIMAGE
- extern struct in6_ifaddr *in6_ifaddr;
- 
- extern struct icmp6stat icmp6stat;
-+#endif
- #define in6_ifstat_inc(ifp, tag) \
- do {								\
- 	if (ifp)						\
 Index: sys/netinet6/ip6_forward.c
 ===========================================================================
 --- sys/netinet6/ip6_forward.c	2008/06/02 18:20:02	#31
@@ -15197,29 +14803,6 @@
  
  #include <net/if.h>
  #include <net/route.h>
-@@ -58,6 +60,7 @@
- #include <netinet/in_systm.h>
- #include <netinet/ip.h>
- #include <netinet/ip_var.h>
-+#include <netinet6/vinet6.h>
- #include <netinet6/in6_var.h>
- #include <netinet/ip6.h>
- #include <netinet6/ip6_var.h>
-@@ -71,11 +74,14 @@
- #include <netipsec/ipsec.h>
- #include <netipsec/ipsec6.h>
- #include <netipsec/key.h>
-+#include <netipsec/vipsec.h>
- #endif /* IPSEC */
- 
- #include <netinet6/ip6protosw.h>
- 
-+#ifndef VIMAGE
- struct	route_in6 ip6_forward_rt;
-+#endif
- 
- /*
-  * Forward a packet.  If some error occurs return the sender
 @@ -92,6 +98,7 @@
  void
  ip6_forward(struct mbuf *m, int srcrt)
@@ -15461,117 +15044,22 @@
  
  #include <sys/param.h>
  #include <sys/systm.h>
-@@ -80,13 +81,16 @@
+@@ -80,13 +81,14 @@
  #include <sys/time.h>
  #include <sys/kernel.h>
  #include <sys/syslog.h>
 +#include <sys/vimage.h>
  
-+#include <net/vnet.h>
  #include <net/if.h>
  #include <net/if_types.h>
  #include <net/if_dl.h>
  #include <net/route.h>
  #include <net/netisr.h>
  #include <net/pfil.h>
-+#include <net/if_gif.h>
  
  #include <netinet/in.h>
  #include <netinet/in_systm.h>
-@@ -95,10 +99,13 @@
- #include <netinet/ip_icmp.h>
- #endif /* INET */
- #include <netinet/ip6.h>
-+#include <netinet/ip6.h>
- #include <netinet6/in6_var.h>
- #include <netinet6/ip6_var.h>
- #include <netinet/in_pcb.h>
- #include <netinet/icmp6.h>
-+
-+#include <netinet6/vinet6.h>
- #include <netinet6/scope6_var.h>
- #include <netinet6/in6_ifattach.h>
- #include <netinet6/nd6.h>
-@@ -115,6 +122,7 @@
- 
- u_char ip6_protox[IPPROTO_MAX];
- static struct ifqueue ip6intrq;
-+#ifndef VIMAGE
- static int ip6qmaxlen = IFQ_MAXLEN;
- struct in6_ifaddr *in6_ifaddr;
- 
-@@ -125,10 +133,13 @@
- int ip6_sourcecheck_interval;		/* XXX */
- 
- int ip6_ours_check_algorithm;
-+#endif /* !VIMAGE */
- 
- struct pfil_head inet6_pfil_hook;
- 
-+#ifndef VIMAGE
- struct ip6stat ip6stat;
-+#endif
- 
- static void ip6_init2(void *);
- static struct ip6aux *ip6_setdstifaddr(struct mbuf *, struct in6_ifaddr *);
-@@ -137,6 +148,19 @@
- static struct mbuf *ip6_pullexthdr(struct mbuf *, size_t, int);
- #endif
- 
-+#ifdef VIMAGE
-+static void vnet_inet6_register(void);
-+ 
-+VNET_MOD_DECLARE(INET6, inet6, NULL, NULL, INET, NULL)
-+ 
-+static void vnet_inet6_register()
-+{
-+        vnet_mod_register(&vnet_inet6_modinfo);
-+}
-+ 
-+SYSINIT(inet6, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, vnet_inet6_register, 0);
-+#endif /* VIMAGE */
-+
- /*
-  * IP6 initialization: fill in IP6 protocol switch table.
-  * All protocols not implemented in kernel go to raw IP6 protocol handler.
-@@ -144,9 +168,36 @@
- void
- ip6_init(void)
- {
-+	INIT_VNET_INET6(curvnet);
- 	struct ip6protosw *pr;
- 	int i;
- 
-+	V_ip6_prefer_tempaddr = 0;
-+
-+	V_ip6qmaxlen = IFQ_MAXLEN;
-+	V_ip6_forward_srcrt = 0;          /* XXX */
-+	V_ip6_sourcecheck = 0;            /* XXX */
-+	V_ip6_sourcecheck_interval = 0;       /* XXX */
-+
-+	V_ip6_ours_check_algorithm = 0;
-+
-+#ifdef IP6_AUTO_LINKLOCAL
-+	V_ip6_auto_linklocal = IP6_AUTO_LINKLOCAL;
-+#else
-+	V_ip6_auto_linklocal = 1;	/* enable by default */
-+#endif
-+
-+	scope6_init();
-+	addrsel_policy_init();
-+	nd6_init();
-+	frag6_init();
-+
-+#ifdef VIMAGE
-+	/* Skip global initialization stuff for non-default instances. */
-+	if (!IS_DEFAULT_VNET(curvnet))
-+		return;
-+#endif
-+
- #ifdef DIAGNOSTIC
- 	if (sizeof(struct protosw) != sizeof(struct ip6protosw))
- 		panic("sizeof(protosw) != sizeof(ip6protosw)");
-@@ -178,41 +229,53 @@
+@@ -178,41 +229,44 @@
  		printf("%s: WARNING: unable to register pfil hook, "
  			"error %d\n", __func__, i);
  
@@ -15579,24 +15067,13 @@
 +	ip6intrq.ifq_maxlen = V_ip6qmaxlen;
  	mtx_init(&ip6intrq.ifq_mtx, "ip6_inq", NULL, MTX_DEF);
  	netisr_register(NETISR_IPV6, ip6_input, &ip6intrq, 0);
--	scope6_init();
--	addrsel_policy_init();
--	nd6_init();
--	frag6_init();
+ 	scope6_init();
+ 	addrsel_policy_init();
+ 	nd6_init();
+ 	frag6_init();
 -	ip6_desync_factor = arc4random() % MAX_TEMP_DESYNC_FACTOR;
 +	V_ip6_desync_factor = arc4random() % MAX_TEMP_DESYNC_FACTOR;
-+}
-+
-+#ifdef VIMAGE
-+void
-+ip6_destroy()
-+{
-+	INIT_VNET_INET6(curvnet);
-+
-+	nd6_destroy();
-+	callout_drain(&V_in6_tmpaddrtimer_ch);
  }
-+#endif
  
  static void
  ip6_init2(void *dummy)
@@ -15626,9 +15103,7 @@
  /* This must be after route_init(), which is now SI_ORDER_THIRD */
  SYSINIT(netinet6init2, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ip6_init2, NULL);
  
-+#ifndef VIMAGE
  extern struct	route_in6 ip6_forward_rt;
-+#endif
  
  void
  ip6_input(struct mbuf *m)
@@ -16116,22 +15591,6 @@
  
  #include <net/if.h>
  #include <net/route.h>
-@@ -61,6 +63,7 @@
- #include <netipsec/ipsec6.h>
- #include <netipsec/xform.h>
- #include <netipsec/key.h>
-+#include <netipsec/vipsec.h>
- #ifdef IPSEC_DEBUG
- #include <netipsec/key_debug.h>
- #else
-@@ -68,6 +71,7 @@
- #endif
- #endif /*IPSEC*/
- 

>>> TRUNCATED FOR MAIL (1000 lines) <<<


More information about the p4-projects mailing list