- ifc->ifc_name, unit);
-
- bzero(&gif_init, sizeof(gif_init));
- gif_init.uniqueid = sc->gif_ifname;
- gif_init.uniqueid_len = strlen(sc->gif_ifname);
- gif_init.name = GIFNAME;
- gif_init.unit = unit;
- gif_init.type = IFT_GIF;
- gif_init.family = IFNET_FAMILY_GIF;
- gif_init.output = gif_output;
- gif_init.demux = gif_demux;
- gif_init.add_proto = gif_add_proto;
- gif_init.del_proto = gif_del_proto;
- gif_init.softc = sc;
- gif_init.ioctl = gif_ioctl;
- gif_init.set_bpf_tap = gif_set_bpf_tap;
-
- result = ifnet_allocate(&gif_init, &sc->gif_if);
- if (result != 0) {
- printf("gif_clone_create, ifnet_allocate failed - %d\n", result);
- _FREE(sc, M_DEVBUF);
- return ENOBUFS;
+ ifc->ifc_name, unit);
+
+ lck_mtx_init(&sc->gif_lock, gif_mtx_grp, gif_mtx_attr);
+
+ bzero(&gif_init_params, sizeof(gif_init_params));
+ gif_init_params.ver = IFNET_INIT_CURRENT_VERSION;
+ gif_init_params.len = sizeof(gif_init_params);
+ gif_init_params.flags = IFNET_INIT_LEGACY;
+ gif_init_params.uniqueid = sc->gif_ifname;
+ gif_init_params.uniqueid_len = strlen(sc->gif_ifname);
+ gif_init_params.name = GIFNAME;
+ gif_init_params.unit = unit;
+ gif_init_params.type = IFT_GIF;
+ gif_init_params.family = IFNET_FAMILY_GIF;
+ gif_init_params.output = gif_output;
+ gif_init_params.demux = gif_demux;
+ gif_init_params.add_proto = gif_add_proto;
+ gif_init_params.del_proto = gif_del_proto;
+ gif_init_params.softc = sc;
+ gif_init_params.ioctl = gif_ioctl;
+ gif_init_params.set_bpf_tap = gif_set_bpf_tap;
+ gif_init_params.detach = gif_detach;
+
+ error = ifnet_allocate_extended(&gif_init_params, &sc->gif_if);
+ if (error != 0) {
+ printf("gif_clone_create, ifnet_allocate failed - %d\n", error);
+ if_clone_softc_deallocate(&gif_cloner, sc);
+ error = ENOBUFS;
+ goto done;