+done:
+ if (sc != NULL) {
+ GIF_UNLOCK(sc);
+ }
+ lck_mtx_unlock(gif_mtx);
+
+ if (encap_cookie6 != NULL) {
+ error = encap_detach(encap_cookie6);
+ KASSERT(error == 0, ("gif_clone_destroy: Unexpected "
+ "error detaching encap_cookie6"));
+ }
+
+ if (encap_cookie4 != NULL) {
+ error = encap_detach(encap_cookie4);
+ KASSERT(error == 0, ("gif_clone_destroy: Unexpected "
+ "error detaching encap_cookie4"));
+ }
+
+ return error;
+}
+
+static int
+gif_clone_destroy(struct ifnet *ifp)
+{
+ int error = 0;
+
+ error = gif_remove(ifp);
+ if (error != 0) {
+ printf("gif_clone_destroy: gif remove failed %d\n", error);
+ return error;
+ }
+