Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Nov 2018 16:50:18 +0000 (UTC)
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r340066 - head/sys/net
Message-ID:  <201811021650.wA2GoIWf024951@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kp
Date: Fri Nov  2 16:50:17 2018
New Revision: 340066
URL: https://svnweb.freebsd.org/changeset/base/340066

Log:
  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.
  
  MFC after:	2 weeks
  Sponsored by:	Orange Business Services
  Differential Revision:	https://reviews.freebsd.org/D17500

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Fri Nov  2 16:47:07 2018	(r340065)
+++ head/sys/net/if.c	Fri Nov  2 16:50:17 2018	(r340066)
@@ -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



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