From 3ee8fed445465b49c3f13d946aca9468c3186c2c Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Tue, 10 May 2011 14:00:03 +0200 Subject: Cache the most recent reqid in the PF_KEY kernel interface. This makes the PF_KEY kernel interface behave the same as the Netlink kernel interface. --- src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c') diff --git a/src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c b/src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c index 75336f2f6..3958ca857 100644 --- a/src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c +++ b/src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c @@ -1618,8 +1618,9 @@ METHOD(kernel_ipsec_t, add_policy, status_t, if (this->policies->find_first(this->policies, (linked_list_match_t)policy_entry_equals, (void**)&found, policy) == SUCCESS) { - /* use existing policy */ + /* use existing policy, but cache the most recent reqid */ found->refcount++; + found->reqid = policy->reqid; DBG2(DBG_KNL, "policy %R === %R %N already exists, increasing " "refcount", src_ts, dst_ts, policy_dir_names, direction); -- cgit v1.2.3