svn commit: r340568 - stable/12/sys/net

Kristof Provost kp at FreeBSD.org
Sun Nov 18 12:04:25 UTC 2018


Author: kp
Date: Sun Nov 18 12:04:24 2018
New Revision: 340568
URL: https://svnweb.freebsd.org/changeset/base/340568

Log:
  MFC r340066:
  
  Notify that the ifnet will go away, even on vnet shutdown
  
  pf subscribes to ifnet_departure_event events, so it can clean up the
  ifg_pf_kif and if_pf_kif pointers in the ifnet.
  During vnet shutdown interfaces could go away without sending the event,
  so pf ends up cleaning these up as part of its shutdown sequence, which
  happens after the ifnet has already been freed.
  
  Send the ifnet_departure_event during vnet shutdown, allowing pf to
  clean up correctly.
  
  Sponsored by:	Orange Business Services

Modified:
  stable/12/sys/net/if.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/net/if.c
==============================================================================
--- stable/12/sys/net/if.c	Sun Nov 18 12:03:12 2018	(r340567)
+++ stable/12/sys/net/if.c	Sun Nov 18 12:04:24 2018	(r340568)
@@ -1122,6 +1122,9 @@ if_detach_internal(struct ifnet *ifp, int vmove, struc
 	 * the work top-down for us.
 	 */
 	if (shutdown) {
+		/* Give interface users the chance to clean up. */
+		EVENTHANDLER_INVOKE(ifnet_departure_event, ifp);
+
 		/*
 		 * In case of a vmove we are done here without error.
 		 * If we would signal an error it would lead to the same


More information about the svn-src-all mailing list