| 367 | } |
| 368 | |
| 369 | static int |
| 370 | if_clone_attach(struct if_clone *ifc) |
| 371 | { |
| 372 | struct if_clone *ifc1; |
| 373 | |
| 374 | IF_CLONERS_LOCK(); |
| 375 | LIST_FOREACH(ifc1, &V_if_cloners, ifc_list) |
| 376 | if (strcmp(ifc->ifc_name, ifc1->ifc_name) == 0) { |
| 377 | IF_CLONERS_UNLOCK(); |
| 378 | IF_CLONE_REMREF(ifc); |
| 379 | return (EEXIST); |
| 380 | } |
| 381 | LIST_INSERT_HEAD(&V_if_cloners, ifc, ifc_list); |
| 382 | V_if_cloners_count++; |
| 383 | IF_CLONERS_UNLOCK(); |
| 384 | |
| 385 | return (0); |
| 386 | } |
| 387 | |
| 388 | struct if_clone * |
| 389 | if_clone_advanced(const char *name, u_int maxunit, ifc_match_t match, |
no test coverage detected