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.
This commit is contained in:
Tobias Brunner 2011-05-10 14:00:03 +02:00
parent 1f3b5c7778
commit 3ee8fed445
1 changed files with 2 additions and 1 deletions

View File

@ -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);