svn commit: r298152 - projects/vnet/sys/net

Bjoern A. Zeeb bz at FreeBSD.org
Sun Apr 17 16:31:25 UTC 2016


Author: bz
Date: Sun Apr 17 16:31:24 2016
New Revision: 298152
URL: https://svnweb.freebsd.org/changeset/base/298152

Log:
  Move the interface teardown (destroy) to SI_SUB_INIT_IF to make interfaces
  go last on network stack teardown.
  We do need to detach the hhook consumers hwever before the L3 protocols
  go away, thus run that detach just befre L3 along with the L4 protocols
  on SI_SUB_PROTO_DOMAIN / SI_ORDER_FOURTH.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  projects/vnet/sys/net/if_enc.c

Modified: projects/vnet/sys/net/if_enc.c
==============================================================================
--- projects/vnet/sys/net/if_enc.c	Sun Apr 17 16:29:24 2016	(r298151)
+++ projects/vnet/sys/net/if_enc.c	Sun Apr 17 16:31:24 2016	(r298152)
@@ -383,12 +383,25 @@ vnet_enc_uninit(const void *unused __unu
 {
 	KASSERT(V_enc_sc != NULL, ("%s: V_enc_sc is %p\n", __func__, V_enc_sc));
 
-	enc_remove_hhooks(V_enc_sc);
 	if_clone_detach(V_enc_cloner);
 }
-VNET_SYSUNINIT(vnet_enc_uninit, SI_SUB_PSEUDO_DONE, SI_ORDER_ANY,
+VNET_SYSUNINIT(vnet_enc_uninit, SI_SUB_INIT_IF, SI_ORDER_ANY,
     vnet_enc_uninit, NULL);
 
+/*
+ * The hhook consumer needs to go before ip[6]_destroy are called on
+ * SI_ORDER_THIRD.
+ */
+static void
+vnet_enc_uninit_hhook(const void *unused __unused)
+{
+	KASSERT(V_enc_sc != NULL, ("%s: V_enc_sc is %p\n", __func__, V_enc_sc));
+
+	enc_remove_hhooks(V_enc_sc);
+}
+VNET_SYSUNINIT(vnet_enc_uninit_hhook, SI_SUB_PROTO_DOMAIN, SI_ORDER_FOURTH,
+    vnet_enc_uninit_hhook, NULL);
+
 static int
 enc_modevent(module_t mod, int type, void *data)
 {


More information about the svn-src-projects mailing list