| 1013 | if_attachdomain, NULL); |
| 1014 | |
| 1015 | static void |
| 1016 | if_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. |
no test coverage detected