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

Function if_attachdomain1

freebsd/net/if.c:1015–1041  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1013 if_attachdomain, NULL);
1014
1015static void
1016if_attachdomain1(struct ifnet *ifp)
1017{
1018 struct domain *dp;
1019
1020 /*
1021 * Since dp->dom_ifattach calls malloc() with M_WAITOK, we
1022 * cannot lock ifp->if_afdata initialization, entirely.
1023 */
1024 IF_AFDATA_LOCK(ifp);
1025 if (ifp->if_afdata_initialized >= domain_init_status) {
1026 IF_AFDATA_UNLOCK(ifp);
1027 log(LOG_WARNING, "%s called more than once on %s\n",
1028 __func__, ifp->if_xname);
1029 return;
1030 }
1031 ifp->if_afdata_initialized = domain_init_status;
1032 IF_AFDATA_UNLOCK(ifp);
1033
1034 /* address family dependent data region */
1035 bzero(ifp->if_afdata, sizeof(ifp->if_afdata));
1036 for (dp = domains; dp; dp = dp->dom_next) {
1037 if (dp->dom_ifattach)
1038 ifp->if_afdata[dp->dom_family] =
1039 (*dp->dom_ifattach)(ifp);
1040 }
1041}
1042
1043/*
1044 * Remove any unicast or broadcast network addresses from an interface.

Callers 2

if_attach_internalFunction · 0.85
if_attachdomainFunction · 0.85

Calls 2

bzeroFunction · 0.85
logFunction · 0.50

Tested by

no test coverage detected