Garbage collect vnet module registrations that have neither constructors
nor destructors, as there's no actual work to do.

In most cases, the constructors weren't needed because of the existing
protocol initialization functions run by net_init_domain() as part of
VNET_MOD_NET, or they were eliminated when support for static
initialization of virtualized globals was added.

Garbage collect dependency references to modules without constructors or
destructors, notably VNET_MOD_INET and VNET_MOD_INET6.

Reviewed by:	

Index: netinet/ip_input.c
===================================================================
--- netinet/ip_input.c	(revision 195769)
+++ netinet/ip_input.c	(working copy)
@@ -236,24 +236,6 @@
 
 static void	ip_freef(struct ipqhead *, struct ipq *);
 
-#ifdef VIMAGE
-/* XXX only has to stay for .vmi_dependson elsewhere. */
-static void vnet_inet_register(void);
- 
-static const vnet_modinfo_t vnet_inet_modinfo = {
-	.vmi_id		= VNET_MOD_INET,
-	.vmi_name	= "inet",
-};
- 
-static void vnet_inet_register()
-{
-  
-	vnet_mod_register(&vnet_inet_modinfo);
-}
- 
-SYSINIT(inet, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, vnet_inet_register, 0);
-#endif
-
 static int
 sysctl_netinet_intr_queue_maxlen(SYSCTL_HANDLER_ARGS)
 {
@@ -302,8 +284,6 @@
 	struct protosw *pr;
 	int i;
 
-	V_ip_id = time_second & 0xffff;
-
 	TAILQ_INIT(&V_in_ifaddrhead);
 	V_in_ifaddrhashtbl = hashinit(INADDR_NHASH, M_IFADDR, &V_in_ifaddrhmask);
 
@@ -362,6 +342,7 @@
 		NULL, EVENTHANDLER_PRI_ANY);
 
 	/* Initialize various other remaining things. */
+	V_ip_id = time_second & 0xffff;
 	IPQ_LOCK_INIT();
 	netisr_register(&ip_nh);
 }
Index: netinet/igmp.c
===================================================================
--- netinet/igmp.c	(revision 195769)
+++ netinet/igmp.c	(working copy)
@@ -224,7 +224,10 @@
 #define	V_current_state_timers_running	VNET(current_state_timers_running)
 
 static VNET_DEFINE(LIST_HEAD(, igmp_ifinfo), igi_head);
-static VNET_DEFINE(struct igmpstat, igmpstat);
+static VNET_DEFINE(struct igmpstat, igmpstat) = {
+	.igps_version = IGPS_VERSION_3,
+	.igps_len = sizeof(struct igmpstat),
+};
 static VNET_DEFINE(struct timeval, igmp_gsrdelay) = {10, 0};
 
 #define	V_igi_head			VNET(igi_head)
@@ -3615,12 +3618,6 @@
 
 	LIST_INIT(&V_igi_head);
 
-	/*
-	 * Initialize sysctls to default values.
-	 */
-	V_igmpstat.igps_version = IGPS_VERSION_3;
-	V_igmpstat.igps_len = sizeof(struct igmpstat);
-
 	return (0);
 }
 
@@ -3640,7 +3637,6 @@
 static vnet_modinfo_t vnet_igmp_modinfo = {
 	.vmi_id		= VNET_MOD_IGMP,
 	.vmi_name	= "igmp",
-	.vmi_dependson	= VNET_MOD_INET,
 	.vmi_iattach	= vnet_igmp_iattach,
 	.vmi_idetach	= vnet_igmp_idetach
 };
Index: net/flowtable.c
===================================================================
--- net/flowtable.c	(revision 195769)
+++ net/flowtable.c	(working copy)
@@ -180,7 +180,6 @@
 static const vnet_modinfo_t flowtable_modinfo = {
 	.vmi_id		= VNET_MOD_FLOWTABLE,
 	.vmi_name	= "flowtable",
-	.vmi_dependson	= VNET_MOD_INET,
 	.vmi_iattach    = flowtable_iattach,
 	.vmi_idetach    = flowtable_idetach
 };
Index: netinet6/mld6.c
===================================================================
--- netinet6/mld6.c	(revision 195769)
+++ netinet6/mld6.c	(working copy)
@@ -3253,7 +3253,6 @@
 static vnet_modinfo_t vnet_mld_modinfo = {
 	.vmi_id		= VNET_MOD_MLD,
 	.vmi_name	= "mld",
-	.vmi_dependson	= VNET_MOD_INET6,
 	.vmi_iattach	= vnet_mld_iattach,
 	.vmi_idetach	= vnet_mld_idetach
 };
Index: netinet6/ip6_input.c
===================================================================
--- netinet6/ip6_input.c	(revision 195769)
+++ netinet6/ip6_input.c	(working copy)
@@ -162,26 +162,6 @@
 static struct mbuf *ip6_pullexthdr(struct mbuf *, size_t, int);
 #endif
 
-#ifdef VIMAGE
-/* XXX only has to stay for .vmi_dependson elsewhere. */
-static void vnet_inet6_register(void);
- 
-static const vnet_modinfo_t vnet_inet6_modinfo = {
-	.vmi_id		= VNET_MOD_INET6,
-	.vmi_name	= "inet6",
-	.vmi_dependson	= VNET_MOD_INET	/* XXX revisit - TCP/UDP needs this? */
-};
- 
-static void
-vnet_inet6_register(void)
-{
-
-	vnet_mod_register(&vnet_inet6_modinfo);
-}
- 
-SYSINIT(inet6, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, vnet_inet6_register, 0);
-#endif
-
 /*
  * IP6 initialization: fill in IP6 protocol switch table.
  * All protocols not implemented in kernel go to raw IP6 protocol handler.
Index: netipsec/xform_ipcomp.c
===================================================================
--- netipsec/xform_ipcomp.c	(revision 195769)
+++ netipsec/xform_ipcomp.c	(working copy)
@@ -81,14 +81,6 @@
 static int ipcomp_input_cb(struct cryptop *crp);
 static int ipcomp_output_cb(struct cryptop *crp);
 
-#ifdef VIMAGE
-static const vnet_modinfo_t vnet_ipcomp_modinfo = {
-	.vmi_id		= VNET_MOD_IPCOMP,
-	.vmi_name	= "ipsec_ipcomp",
-	.vmi_dependson	= VNET_MOD_IPSEC,
-};
-#endif
-
 struct comp_algo *
 ipcomp_algorithm_lookup(int alg)
 {
@@ -604,9 +596,6 @@
 {
 
 	xform_register(&ipcomp_xformsw);
-#ifdef VIMAGE
-	vnet_mod_register(&vnet_ipcomp_modinfo);
-#endif
 }
 
 SYSINIT(ipcomp_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ipcomp_attach, NULL);
Index: netipsec/ipsec.c
===================================================================
--- netipsec/ipsec.c	(revision 195769)
+++ netipsec/ipsec.c	(working copy)
@@ -245,7 +245,6 @@
 static const vnet_modinfo_t vnet_ipsec_modinfo = {
 	.vmi_id		= VNET_MOD_IPSEC,
 	.vmi_name	= "ipsec",
-	.vmi_dependson	= VNET_MOD_INET,	/* XXX revisit - INET6 ? */
 	.vmi_iattach	= ipsec_iattach,
 };
 #endif
Index: netipsec/xform_ipip.c
===================================================================
--- netipsec/xform_ipip.c	(revision 195769)
+++ netipsec/xform_ipip.c	(working copy)
@@ -105,14 +105,6 @@
 
 static void _ipip_input(struct mbuf *m, int iphlen, struct ifnet *gifp);
 
-#ifdef VIMAGE
-static const vnet_modinfo_t vnet_ipip_modinfo = {
-	.vmi_id		= VNET_MOD_IPIP,
-	.vmi_name	= "ipsec_ipip",
-	.vmi_dependson	= VNET_MOD_IPSEC,
-};
-#endif
-
 #ifdef INET6
 /*
  * Really only a wrapper for ipip_input(), for use with IPv6.
@@ -710,9 +702,6 @@
 	(void) encap_attach_func(AF_INET6, -1,
 		ipe4_encapcheck, (struct protosw *)&ipe6_protosw, NULL);
 #endif
-#ifdef VIMAGE
-	vnet_mod_register(&vnet_ipip_modinfo);
-#endif
 }
 SYSINIT(ipe4_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ipe4_attach, NULL);
 #endif	/* IPSEC */
