Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/sctp_bsd_addr.c
Show First 20 Lines • Show All 192 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
sctp_init_ifns_for_vrf(int vrfid) | sctp_init_ifns_for_vrf(int vrfid) | ||||
{ | { | ||||
/* | /* | ||||
* Here we must apply ANY locks needed by the IFN we access and also | * Here we must apply ANY locks needed by the IFN we access and also | ||||
* make sure we lock any IFA that exists as we float through the | * make sure we lock any IFA that exists as we float through the | ||||
* list of IFA's | * list of IFA's | ||||
*/ | */ | ||||
struct epoch_tracker et; | |||||
struct ifnet *ifn; | struct ifnet *ifn; | ||||
struct ifaddr *ifa; | struct ifaddr *ifa; | ||||
struct sctp_ifa *sctp_ifa; | struct sctp_ifa *sctp_ifa; | ||||
uint32_t ifa_flags; | uint32_t ifa_flags; | ||||
#ifdef INET6 | #ifdef INET6 | ||||
struct in6_ifaddr *ifa6; | struct in6_ifaddr *ifa6; | ||||
#endif | #endif | ||||
NET_EPOCH_ENTER(et); | |||||
IFNET_RLOCK(); | IFNET_RLOCK(); | ||||
CK_STAILQ_FOREACH(ifn, &MODULE_GLOBAL(ifnet), if_link) { | CK_STAILQ_FOREACH(ifn, &MODULE_GLOBAL(ifnet), if_link) { | ||||
struct epoch_tracker et; | |||||
if (sctp_is_desired_interface_type(ifn) == 0) { | if (sctp_is_desired_interface_type(ifn) == 0) { | ||||
/* non desired type */ | /* non desired type */ | ||||
continue; | continue; | ||||
} | } | ||||
NET_EPOCH_ENTER(et); | |||||
CK_STAILQ_FOREACH(ifa, &ifn->if_addrhead, ifa_link) { | CK_STAILQ_FOREACH(ifa, &ifn->if_addrhead, ifa_link) { | ||||
if (ifa->ifa_addr == NULL) { | if (ifa->ifa_addr == NULL) { | ||||
continue; | continue; | ||||
} | } | ||||
switch (ifa->ifa_addr->sa_family) { | switch (ifa->ifa_addr->sa_family) { | ||||
#ifdef INET | #ifdef INET | ||||
case AF_INET: | case AF_INET: | ||||
if (((struct sockaddr_in *)ifa->ifa_addr)->sin_addr.s_addr == 0) { | if (((struct sockaddr_in *)ifa->ifa_addr)->sin_addr.s_addr == 0) { | ||||
Show All 36 Lines | #endif | ||||
(void *)ifa, | (void *)ifa, | ||||
ifa->ifa_addr, | ifa->ifa_addr, | ||||
ifa_flags, | ifa_flags, | ||||
0); | 0); | ||||
if (sctp_ifa) { | if (sctp_ifa) { | ||||
sctp_ifa->localifa_flags &= ~SCTP_ADDR_DEFER_USE; | sctp_ifa->localifa_flags &= ~SCTP_ADDR_DEFER_USE; | ||||
} | } | ||||
} | } | ||||
NET_EPOCH_EXIT(et); | |||||
} | } | ||||
IFNET_RUNLOCK(); | IFNET_RUNLOCK(); | ||||
NET_EPOCH_EXIT(et); | |||||
} | } | ||||
void | void | ||||
sctp_init_vrf_list(int vrfid) | sctp_init_vrf_list(int vrfid) | ||||
{ | { | ||||
if (vrfid > SCTP_MAX_VRF_ID) | if (vrfid > SCTP_MAX_VRF_ID) | ||||
/* can't do that */ | /* can't do that */ | ||||
return; | return; | ||||
▲ Show 20 Lines • Show All 270 Lines • Show Last 20 Lines |