FreeBSD/sys/netinet/sctp_asconf.c
/*
 * makes sure that the current endpoint local addr list is consistent with
 * the new association (eg. subset bound, asconf allowed) adds addresses as
 * necessary
 */
makes sure that the current endpoint local addr list is consistent with
the new association  adds addresses as
necessary
makes sure that the current endpoint local addr list is consistent with the new association adds addresses as necessary
static void
sctp_check_address_list_ep(struct sctp_tcb *stcb, struct mbuf *m, int offset,
    int length, struct sockaddr *init_addr)
{
	struct sctp_laddr *laddr;
	LIST_FOREACH(laddr, &stcb->sctp_ep->sctp_addr_list, sctp_nxt_addr) {
		if (laddr->ifa == NULL) {
			SCTPDBG(SCTP_DEBUG_ASCONF1,
			    "check_addr_list_ep: laddr->ifa is NULL");
			continue;
		}
		if (laddr->ifa == NULL) {
			SCTPDBG(SCTP_DEBUG_ASCONF1, "check_addr_list_ep: laddr->ifa->ifa_addr is NULL");
			continue;
		}
		if (sctp_cmpaddr(&laddr->ifa->address.sa, init_addr)) {
			continue;
		}
		if (!sctp_addr_in_initack(m, offset, length, &laddr->ifa->address.sa)) {
			sctp_addr_mgmt_assoc(stcb->sctp_ep, stcb, laddr->ifa,
			    SCTP_ADD_IP_ADDRESS, SCTP_ADDR_NOT_LOCKED);
		}
	}
}
static void sctp_check_address_list_ep ( struct sctp_tcb * stcb , struct mbuf * m , int offset , int length , struct sockaddr * init_addr ) { struct sctp_laddr * laddr ; LIST_FOREACH ( laddr , & stcb -> sctp_ep -> sctp_addr_list , sctp_nxt_addr ) { if ( laddr -> ifa == NULL ) { SCTPDBG ( SCTP_DEBUG_ASCONF1 , " " ) ; continue ; } if ( laddr -> ifa == NULL ) { SCTPDBG ( SCTP_DEBUG_ASCONF1 , " " ) ; continue ; } if ( sctp_cmpaddr ( & laddr -> ifa -> address . sa , init_addr ) ) { continue ; } if ( ! sctp_addr_in_initack ( m , offset , length , & laddr -> ifa -> address . sa ) ) { sctp_addr_mgmt_assoc ( stcb -> sctp_ep , stcb , laddr -> ifa , SCTP_ADD_IP_ADDRESS , SCTP_ADDR_NOT_LOCKED ) ; } } }
makes sure that the current endpoint local addr list is consistent with
 the new association (eg.
makes sure that the current endpoint local addr list is consistent with the new association ( eg .
/* go through the endpoint list */ /* be paranoid and validate the laddr */ /* do i have it implicitly? */ /* check to see if in the init-ack */ /* try to add it */