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

Function sctp_auth_setactivekey_ep

freebsd/netinet/sctp_auth.c:1279–1292  ·  view source on GitHub ↗

- * set the active key on an endpoint * ASSUMES INP_WLOCK is already held */

Source from the content-addressed store, hash-verified

1277 * ASSUMES INP_WLOCK is already held
1278 */
1279int
1280sctp_auth_setactivekey_ep(struct sctp_inpcb *inp, uint16_t keyid)
1281{
1282 sctp_sharedkey_t *skey;
1283
1284 /* find the key */
1285 skey = sctp_find_sharedkey(&inp->sctp_ep.shared_keys, keyid);
1286 if (skey == NULL) {
1287 /* that key doesn't exist */
1288 return (-1);
1289 }
1290 inp->sctp_ep.default_keyid = keyid;
1291 return (0);
1292}
1293
1294/*-
1295 * deactivates a shared key from the association

Callers 1

sctp_setoptFunction · 0.85

Calls 1

sctp_find_sharedkeyFunction · 0.85

Tested by

no test coverage detected