aboutsummaryrefslogtreecommitdiffstats
path: root/src/libhydra/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/libhydra/plugins')
-rw-r--r--src/libhydra/plugins/kernel_klips/kernel_klips_ipsec.c5
-rw-r--r--src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c6
2 files changed, 6 insertions, 5 deletions
diff --git a/src/libhydra/plugins/kernel_klips/kernel_klips_ipsec.c b/src/libhydra/plugins/kernel_klips/kernel_klips_ipsec.c
index 38c92ce71..82f80fd4c 100644
--- a/src/libhydra/plugins/kernel_klips/kernel_klips_ipsec.c
+++ b/src/libhydra/plugins/kernel_klips/kernel_klips_ipsec.c
@@ -2022,7 +2022,7 @@ METHOD(kernel_ipsec_t, add_policy, status_t,
else
{
/* apply the new one, if we have no such policy */
- this->policies->insert_last(this->policies, policy);
+ this->policies->insert_first(this->policies, policy);
}
if (priority == POLICY_PRIORITY_ROUTED)
@@ -2088,7 +2088,8 @@ METHOD(kernel_ipsec_t, add_policy, status_t,
this->mutex->lock(this->mutex);
/* we try to find the policy again and install the route if needed */
- if (this->policies->find_last(this->policies, NULL, (void**)&policy) != SUCCESS)
+ if (this->policies->find_first(this->policies, NULL,
+ (void**)&policy) != SUCCESS)
{
this->mutex->unlock(this->mutex);
DBG2(DBG_KNL, "the policy %R === %R %N is already gone, ignoring",
diff --git a/src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c b/src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c
index f00210b85..d975f15b9 100644
--- a/src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c
+++ b/src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c
@@ -2261,8 +2261,8 @@ static status_t add_policy_internal(private_kernel_pfkey_ipsec_t *this,
/* we try to find the policy again and update the kernel index */
this->mutex->lock(this->mutex);
- if (this->policies->find_last(this->policies, NULL,
- (void**)&policy) != SUCCESS)
+ if (this->policies->find_first(this->policies, NULL,
+ (void**)&policy) != SUCCESS)
{
DBG2(DBG_KNL, "unable to update index, the policy is already gone, "
"ignoring");
@@ -2319,7 +2319,7 @@ METHOD(kernel_ipsec_t, add_policy, status_t,
}
else
{ /* use the new one, if we have no such policy */
- this->policies->insert_last(this->policies, policy);
+ this->policies->insert_first(this->policies, policy);
policy->used_by = linked_list_create();
}