* Search SA by SPI. * OUT: * NULL : not found * others : found, referenced pointer to a SA. */
| 3166 | * others : found, referenced pointer to a SA. |
| 3167 | */ |
| 3168 | static struct secasvar * |
| 3169 | key_getsavbyspi(uint32_t spi) |
| 3170 | { |
| 3171 | SAHTREE_RLOCK_TRACKER; |
| 3172 | struct secasvar *sav; |
| 3173 | |
| 3174 | /* Assume SPI is in network byte order */ |
| 3175 | SAHTREE_RLOCK(); |
| 3176 | LIST_FOREACH(sav, SAVHASH_HASH(spi), spihash) { |
| 3177 | if (sav->spi != spi) |
| 3178 | continue; |
| 3179 | SAV_ADDREF(sav); |
| 3180 | break; |
| 3181 | } |
| 3182 | SAHTREE_RUNLOCK(); |
| 3183 | return (sav); |
| 3184 | } |
| 3185 | |
| 3186 | static int |
| 3187 | key_updatelifetimes(struct secasvar *sav, const struct sadb_msghdr *mhp) |
no outgoing calls
no test coverage detected