FreeBSD/sys/netinet/sctp_asconf.c
/*
 * cleanup any cached source addresses that may be topologically
 * incorrect after a new address has been added to this interface.
 */
cleanup any cached source addresses that may be topologically
incorrect after a new address has been added to this interface.
cleanup any cached source addresses that may be topologically incorrect after a new address has been added to this interface .
static void
sctp_asconf_nets_cleanup(struct sctp_tcb *stcb, struct sctp_ifn *ifn)
{
	struct sctp_nets *net;
	TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
		if (SCTP_ROUTE_HAS_VALID_IFN(&net->ro) &&
		    ((ifn == NULL) ||
		    (SCTP_GET_IF_INDEX_FROM_ROUTE(&net->ro) != ifn->ifn_index))) {
			RTFREE(net->ro.ro_rt);
			net->ro.ro_rt = NULL;
		}
		if (net->src_addr_selected) {
			sctp_free_ifa(net->ro._s_addr);
			net->ro._s_addr = NULL;
			net->src_addr_selected = 0;
		}
	}
}
static void sctp_asconf_nets_cleanup ( struct sctp_tcb * stcb , struct sctp_ifn * ifn ) { struct sctp_nets * net ; TAILQ_FOREACH ( net , & stcb -> asoc . nets , sctp_next ) { if ( SCTP_ROUTE_HAS_VALID_IFN ( & net -> ro ) && ( ( ifn == NULL ) || ( SCTP_GET_IF_INDEX_FROM_ROUTE ( & net -> ro ) != ifn -> ifn_index ) ) ) { RTFREE ( net -> ro . ro_rt ) ; net -> ro . ro_rt = NULL ; } if ( net -> src_addr_selected ) { sctp_free_ifa ( net -> ro . _s_addr ) ; net -> ro . _s_addr = NULL ; net -> src_addr_selected = 0 ; } } }
cleanup any cached source addresses that may be topologically
 incorrect after a new address has been added to this interface.
cleanup any cached source addresses that may be topologically incorrect after a new address has been added to this interface .
/*
	 * Ideally, we want to only clear cached routes and source addresses
	 * that are topologically incorrect.  But since there is no easy way
	 * to know whether the newly added address on the ifn would cause a
	 * routing change (i.e. a new egress interface would be chosen)
	 * without doing a new routing lookup and source address selection,
	 * we will (for now) just flush any cached route using a different
	 * ifn (and cached source addrs) and let output re-choose them
	 * during the next send on that net.
	 */ /*
		 * clear any cached route (and cached source address) if the
		 * route's interface is NOT the same as the address change.
		 * If it's the same interface, just clear the cached source
		 * address.
		 */ /* clear any cached route */ /* clear any cached source address */