Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if_clone.c
Context not available. | |||||
int err; | int err; | ||||
struct ifnet *ifp; | struct ifnet *ifp; | ||||
if (ifunit(name) != NULL) | IFNET_RLOCK(); | ||||
if (if_checkname(name)) { | |||||
IFNET_RUNLOCK(); | |||||
return (EEXIST); | return (EEXIST); | ||||
} | |||||
IFNET_RUNLOCK(); | |||||
if (ifc->ifc_type == SIMPLE) | if (ifc->ifc_type == SIMPLE) | ||||
err = ifc_simple_create(ifc, name, len, params); | err = ifc_simple_create(ifc, name, len, params); | ||||
Context not available. | |||||
} | } | ||||
snprintf(name, IFNAMSIZ, "%s%d", ifc->ifc_name, *unit); | snprintf(name, IFNAMSIZ, "%s%d", ifc->ifc_name, *unit); | ||||
if (ifunit(name) != NULL) { | IFNET_RLOCK(); | ||||
if (if_checkname(name)) { | |||||
IFNET_RUNLOCK(); | |||||
free_unr(ifc->ifc_unrhdr, *unit); | free_unr(ifc->ifc_unrhdr, *unit); | ||||
if (wildcard) { | if (wildcard) { | ||||
(*unit)++; | (*unit)++; | ||||
Context not available. | |||||
} else | } else | ||||
return (EEXIST); | return (EEXIST); | ||||
} | } | ||||
IFNET_RUNLOCK(); | |||||
IF_CLONE_ADDREF(ifc); | IF_CLONE_ADDREF(ifc); | ||||
Context not available. |