HomeFreeBSD

Add SPDB generation id 'sp_genid' variable and key_getspgen() function

Description

Add SPDB generation id 'sp_genid' variable and key_getspgen() function
to read its value. This variable incremented when security policy
added or deleted from SPDB.
Modify key_insertsp(), key_unlink() and key_spdflush() to modify
generation id.

Change condition in key_unlink(). Now we have many different SP states,
but only SPs with IPSEC_SPSTATE_ALIVE state are linked into the SPDB.
If SP has different state, do not try to unlink it. Also remove SP
from idhash when it becomes unlinked.

Change key_insertsp(), now it should be called with acquired SPTREE_LOCK.
Also add new SP into idhash when it linked into SPDB.

In key_spdflush() remove all flushed SPs from idhash.

Details

Provenance
aeAuthored on
Parents
rS308878: Add hash table for lookup security policy by SP id.
Branches
Unknown
Tags
Unknown