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

Function sctp_find_valid_localaddr_ep

freebsd/netinet/sctp_asconf.c:2529–2548  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2527}
2528
2529static struct sockaddr *
2530sctp_find_valid_localaddr_ep(struct sctp_tcb *stcb)
2531{
2532 struct sctp_laddr *laddr;
2533
2534 LIST_FOREACH(laddr, &stcb->sctp_ep->sctp_addr_list, sctp_nxt_addr) {
2535 if (laddr->ifa == NULL) {
2536 continue;
2537 }
2538 /* is the address restricted ? */
2539 if (sctp_is_addr_restricted(stcb, laddr->ifa) &&
2540 (!sctp_is_addr_pending(stcb, laddr->ifa)))
2541 continue;
2542
2543 /* found a valid local address to use */
2544 return (&laddr->ifa->address.sa);
2545 }
2546 /* no valid addresses found */
2547 return (NULL);
2548}
2549
2550/*
2551 * builds an ASCONF chunk from queued ASCONF params.

Callers 1

sctp_compose_asconfFunction · 0.85

Calls 2

sctp_is_addr_restrictedFunction · 0.85
sctp_is_addr_pendingFunction · 0.85

Tested by

no test coverage detected