socsvn commit: r303931 - soc2016/vincenzo/head/sys/dev/netmap

vincenzo at FreeBSD.org vincenzo at FreeBSD.org
Thu May 26 15:33:32 UTC 2016


Author: vincenzo
Date: Thu May 26 15:33:31 2016
New Revision: 303931
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=303931

Log:
  ptnet: implement detach function

Modified:
  soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c

Modified: soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c
==============================================================================
--- soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c	Thu May 26 14:26:49 2016	(r303930)
+++ soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c	Thu May 26 15:33:31 2016	(r303931)
@@ -207,6 +207,17 @@
 
 	printf("%s\n", __func__);
 
+	if (device_is_attached(dev)) {
+		ether_ifdetach(sc->ifp);
+	}
+
+	ifmedia_removeall(&sc->media);
+
+	if (sc->ifp) {
+		if_free(sc->ifp);
+		sc->ifp = NULL;
+	}
+
 	PTNET_CORE_LOCK_FINI(sc);
 
 	return (0);


More information about the svn-soc-all mailing list