diff options
Diffstat (limited to 'sys/netipsec/key.c')
-rw-r--r-- | sys/netipsec/key.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index 3cc5a6c..c5aa4b7 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -2852,9 +2852,10 @@ key_newsav(m, mhp, sah, errp, where, tag) sa_initref(newsav); newsav->state = SADB_SASTATE_LARVAL; - /* XXX locking??? */ + SAHTREE_LOCK(); LIST_INSERT_TAIL(&sah->savtree[SADB_SASTATE_LARVAL], newsav, secasvar, chain); + SAHTREE_UNLOCK(); done: KEYDEBUG(KEYDEBUG_IPSEC_STAMP, printf("DP %s from %s:%u return SP:%p\n", __func__, @@ -5698,8 +5699,8 @@ key_delete(so, m, mhp) } key_sa_chgstate(sav, SADB_SASTATE_DEAD); - SAHTREE_UNLOCK(); KEY_FREESAV(&sav); + SAHTREE_UNLOCK(); { struct mbuf *n; |