charon-tkm: Store remote SPI in SAD
Store the remote instead of the local SPI in the SAD when adding a new entry in the kernel plugin's add_sa() function. Since only one ESA context must be destroyed for an inbound/outbound CHILD SA pair, it does not matter which SPI is used to retrieve it in the del_sa function.
This commit is contained in:
committed by
Martin Willi
parent
fa4f66cba3
commit
e1e854bd0c
@@ -136,7 +136,7 @@ METHOD(kernel_ipsec_t, add_sa, status_t,
|
|||||||
}
|
}
|
||||||
|
|
||||||
esa_id = tkm->idmgr->acquire_id(tkm->idmgr, TKM_CTX_ESA);
|
esa_id = tkm->idmgr->acquire_id(tkm->idmgr, TKM_CTX_ESA);
|
||||||
if (!tkm->sad->insert(tkm->sad, esa_id, peer, local, spi_loc, protocol))
|
if (!tkm->sad->insert(tkm->sad, esa_id, local, peer, spi_rem, protocol))
|
||||||
{
|
{
|
||||||
DBG1(DBG_KNL, "unable to add entry (%llu) to SAD", esa_id);
|
DBG1(DBG_KNL, "unable to add entry (%llu) to SAD", esa_id);
|
||||||
goto sad_failure;
|
goto sad_failure;
|
||||||
|
|||||||
Reference in New Issue
Block a user