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

Function ifunit_ref

freebsd/net/if.c:2356–2372  ·  view source on GitHub ↗

* Map interface name to interface structure pointer, with or without * returning a reference. */

Source from the content-addressed store, hash-verified

2354 * returning a reference.
2355 */
2356struct ifnet *
2357ifunit_ref(const char *name)
2358{
2359 struct epoch_tracker et;
2360 struct ifnet *ifp;
2361
2362 NET_EPOCH_ENTER(et);
2363 CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) {
2364 if (strncmp(name, ifp->if_xname, IFNAMSIZ) == 0 &&
2365 !(ifp->if_flags & IFF_DYING))
2366 break;
2367 }
2368 if (ifp != NULL)
2369 if_ref(ifp);
2370 NET_EPOCH_EXIT(et);
2371 return (ifp);
2372}
2373
2374struct ifnet *
2375ifunit(const char *name)

Callers 14

krping_get_ipv6_scope_idFunction · 0.85
pfsyncioctlFunction · 0.85
ipfw_kiflookupFunction · 0.85
nptv6_find_prefixFunction · 0.85
carp_ioctlFunction · 0.85
netdump_configureFunction · 0.85
ifioctlFunction · 0.85
if_clone_destroyFunction · 0.85
vxlan_set_hwcapsFunction · 0.85
lagg_ioctlFunction · 0.85

Calls 2

strncmpFunction · 0.85
if_refFunction · 0.85

Tested by

no test coverage detected