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

Function if_clone_createif

freebsd/net/if_clone.c:229–252  ·  view source on GitHub ↗

* Create a clone network interface. */

Source from the content-addressed store, hash-verified

227 * Create a clone network interface.
228 */
229static int
230if_clone_createif(struct if_clone *ifc, char *name, size_t len, caddr_t params)
231{
232 int err;
233 struct ifnet *ifp;
234
235 if (ifunit(name) != NULL)
236 return (EEXIST);
237
238 if (ifc->ifc_type == SIMPLE)
239 err = ifc_simple_create(ifc, name, len, params);
240 else
241 err = (*ifc->ifc_create)(ifc, name, len, params);
242
243 if (!err) {
244 ifp = ifunit(name);
245 if (ifp == NULL)
246 panic("%s: lookup failed for %s", __func__, name);
247
248 if_clone_addif(ifc, ifp);
249 }
250
251 return (err);
252}
253
254/*
255 * Lookup and destroy a clone network interface.

Callers 2

if_clone_createFunction · 0.85
if_clone_simpleFunction · 0.85

Calls 4

ifunitFunction · 0.85
ifc_simple_createFunction · 0.85
if_clone_addifFunction · 0.85
panicFunction · 0.50

Tested by

no test coverage detected