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

Function ifc_alloc_unit_specific

freebsd/net/if_clone.c:608–628  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

606}
607
608static int
609ifc_alloc_unit_specific(struct if_clone *ifc, int *unit)
610{
611 char name[IFNAMSIZ];
612
613 if (*unit > ifc->ifc_maxunit)
614 return (ENOSPC);
615
616 if (alloc_unr_specific(ifc->ifc_unrhdr, *unit) == -1)
617 return (EEXIST);
618
619 snprintf(name, IFNAMSIZ, "%s%d", ifc->ifc_name, *unit);
620 if (ifunit(name) != NULL) {
621 free_unr(ifc->ifc_unrhdr, *unit);
622 return (EEXIST);
623 }
624
625 IF_CLONE_ADDREF(ifc);
626
627 return (0);
628}
629
630static int
631ifc_alloc_unit_next(struct if_clone *ifc, int *unit)

Callers 2

ifc_alloc_unit_nextFunction · 0.85
ifc_alloc_unitFunction · 0.85

Calls 4

alloc_unr_specificFunction · 0.85
snprintfFunction · 0.85
ifunitFunction · 0.85
free_unrFunction · 0.85

Tested by

no test coverage detected