* if_clone_findifc() looks up ifnet from the current * cloner list, and returns ifc if found. Note that ifc_refcnt * is incremented. */
| 531 | * is incremented. |
| 532 | */ |
| 533 | struct if_clone * |
| 534 | if_clone_findifc(struct ifnet *ifp) |
| 535 | { |
| 536 | struct if_clone *ifc, *ifc0; |
| 537 | struct ifnet *ifcifp; |
| 538 | |
| 539 | ifc0 = NULL; |
| 540 | IF_CLONERS_LOCK(); |
| 541 | LIST_FOREACH(ifc, &V_if_cloners, ifc_list) { |
| 542 | IF_CLONE_LOCK(ifc); |
| 543 | LIST_FOREACH(ifcifp, &ifc->ifc_iflist, if_clones) { |
| 544 | if (ifp == ifcifp) { |
| 545 | ifc0 = ifc; |
| 546 | IF_CLONE_ADDREF_LOCKED(ifc); |
| 547 | break; |
| 548 | } |
| 549 | } |
| 550 | IF_CLONE_UNLOCK(ifc); |
| 551 | if (ifc0 != NULL) |
| 552 | break; |
| 553 | } |
| 554 | IF_CLONERS_UNLOCK(); |
| 555 | |
| 556 | return (ifc0); |
| 557 | } |
| 558 | |
| 559 | /* |
| 560 | * if_clone_addgroup() decrements ifc_refcnt because it is called after |
no outgoing calls
no test coverage detected