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

Function key_getsah

freebsd/netipsec/key.c:3123–3138  ·  view source on GitHub ↗

* search SAH. * OUT: * NULL : not found * others : found, referenced pointer to a SAH. */

Source from the content-addressed store, hash-verified

3121 * others : found, referenced pointer to a SAH.
3122 */
3123static struct secashead *
3124key_getsah(struct secasindex *saidx)
3125{
3126 SAHTREE_RLOCK_TRACKER;
3127 struct secashead *sah;
3128
3129 SAHTREE_RLOCK();
3130 LIST_FOREACH(sah, SAHADDRHASH_HASH(saidx), addrhash) {
3131 if (key_cmpsaidx(&sah->saidx, saidx, CMP_MODE_REQID) != 0) {
3132 SAH_ADDREF(sah);
3133 break;
3134 }
3135 }
3136 SAHTREE_RUNLOCK();
3137 return (sah);
3138}
3139
3140/*
3141 * Check not to be duplicated SPI.

Callers 2

key_newsavFunction · 0.85
key_updateaddressesFunction · 0.85

Calls 1

key_cmpsaidxFunction · 0.85

Tested by

no test coverage detected