| 349 | } |
| 350 | |
| 351 | static struct if_clone * |
| 352 | if_clone_alloc(const char *name, int maxunit) |
| 353 | { |
| 354 | struct if_clone *ifc; |
| 355 | |
| 356 | KASSERT(name != NULL, ("%s: no name\n", __func__)); |
| 357 | |
| 358 | ifc = malloc(sizeof(struct if_clone), M_CLONE, M_WAITOK | M_ZERO); |
| 359 | strncpy(ifc->ifc_name, name, IFCLOSIZ-1); |
| 360 | IF_CLONE_LOCK_INIT(ifc); |
| 361 | IF_CLONE_ADDREF(ifc); |
| 362 | ifc->ifc_maxunit = maxunit ? maxunit : IF_MAXUNIT; |
| 363 | ifc->ifc_unrhdr = new_unrhdr(0, ifc->ifc_maxunit, &ifc->ifc_mtx); |
| 364 | LIST_INIT(&ifc->ifc_iflist); |
| 365 | |
| 366 | return (ifc); |
| 367 | } |
| 368 | |
| 369 | static int |
| 370 | if_clone_attach(struct if_clone *ifc) |
no test coverage detected