MCPcopy Create free account
hub / github.com/F-Stack/f-stack / if_clone_findifc

Function if_clone_findifc

freebsd/net/if_clone.c:533–557  ·  view source on GitHub ↗

* if_clone_findifc() looks up ifnet from the current * cloner list, and returns ifc if found. Note that ifc_refcnt * is incremented. */

Source from the content-addressed store, hash-verified

531 * is incremented.
532 */
533struct if_clone *
534if_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

Callers 1

if_detach_internalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected