FreeBSD/sys/netinet/sctp_auth.c
/*-
 * deactivates a shared key from the endpoint
 * ASSUMES INP_WLOCK is already held
 */
deactivates a shared key from the endpoint
ASSUMES INP_WLOCK is already held
deactivates a shared key from the endpoint ASSUMES INP_WLOCK is already held
int
sctp_deact_sharedkey_ep(struct sctp_inpcb *inp, uint16_t keyid)
{
	sctp_sharedkey_t *skey;
	if (inp == NULL)
		return (-1);
	if (keyid == inp->sctp_ep.default_keyid)
		return (-1);
	skey = sctp_find_sharedkey(&inp->sctp_ep.shared_keys, keyid);
	if (skey == NULL)
		return (-1);
	LIST_REMOVE(skey, next);
	sctp_free_sharedkey(skey);	
	return (0);
}
int sctp_deact_sharedkey_ep ( struct sctp_inpcb * inp , uint16_t keyid ) { sctp_sharedkey_t * skey ; if ( inp == NULL ) return ( -1 ) ; if ( keyid == inp -> sctp_ep . default_keyid ) return ( -1 ) ; skey = sctp_find_sharedkey ( & inp -> sctp_ep . shared_keys , keyid ) ; if ( skey == NULL ) return ( -1 ) ; LIST_REMOVE ( skey , next ) ; sctp_free_sharedkey ( skey ) ; return ( 0 ) ; }
deactivates a shared key from the endpoint
 ASSUMES INP_WLOCK is already held
deactivates a shared key from the endpoint ASSUMES INP_WLOCK is already held
/* is the keyid the active sending key on the endpoint */ /* does the key exist? */ /* endpoint keys are not refcounted */ /* remove it */ /* frees skey->key as well */