* search SAH. * OUT: * NULL : not found * others : found, referenced pointer to a SAH. */
| 3121 | * others : found, referenced pointer to a SAH. |
| 3122 | */ |
| 3123 | static struct secashead * |
| 3124 | key_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. |
no test coverage detected