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

Function sctp_auth_key_release

freebsd/netinet/sctp_auth.c:563–588  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

561}
562
563void
564sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t key_id, int so_locked)
565{
566 sctp_sharedkey_t *skey;
567
568 /* find the shared key */
569 skey = sctp_find_sharedkey(&stcb->asoc.shared_keys, key_id);
570
571 /* decrement the ref count */
572 if (skey) {
573 SCTPDBG(SCTP_DEBUG_AUTH2,
574 "%s: stcb %p key %u refcount release to %d\n",
575 __func__, (void *)stcb, key_id, skey->refcount);
576
577 /* see if a notification should be generated */
578 if ((skey->refcount <= 2) && (skey->deactivated)) {
579 /* notify ULP that key is no longer used */
580 sctp_ulp_notify(SCTP_NOTIFY_AUTH_FREE_KEY, stcb,
581 key_id, 0, so_locked);
582 SCTPDBG(SCTP_DEBUG_AUTH2,
583 "%s: stcb %p key %u no longer used, %d\n",
584 __func__, (void *)stcb, key_id, skey->refcount);
585 }
586 sctp_free_sharedkey(skey);
587 }
588}
589
590static sctp_sharedkey_t *
591sctp_copy_sharedkey(const sctp_sharedkey_t *skey)

Callers 3

sctp_clean_up_streamFunction · 0.85
sctp_free_assocFunction · 0.85

Calls 3

sctp_find_sharedkeyFunction · 0.85
sctp_ulp_notifyFunction · 0.85
sctp_free_sharedkeyFunction · 0.85

Tested by

no test coverage detected